2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:17:53 +01:00
|
|
|
#ifndef INCLUDED_SW_INC_SWREGION_HXX
|
|
|
|
#define INCLUDED_SW_INC_SWREGION_HXX
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-07-20 12:08:29 +02:00
|
|
|
#include <vector>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include "swrect.hxx"
|
|
|
|
|
2012-07-20 12:08:29 +02:00
|
|
|
typedef std::vector<SwRect> SwRects;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
class SwRegionRects : public SwRects
|
|
|
|
{
|
2011-04-18 22:25:24 +02:00
|
|
|
SwRect aOrigin; // Copy of StartRect.
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-07-20 12:08:29 +02:00
|
|
|
inline void InsertRect( const SwRect &rRect, const sal_uInt16 nPos, bool &rDel);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
public:
|
2012-01-21 15:21:16 +01:00
|
|
|
SwRegionRects( const SwRect& rStartRect, sal_uInt16 nInit = 20 );
|
2011-04-18 22:25:24 +02:00
|
|
|
|
|
|
|
// For punching from aOrigin.
|
2000-09-18 16:15:01 +00:00
|
|
|
void operator-=( const SwRect& rRect );
|
2014-08-12 20:15:02 +02:00
|
|
|
void operator+=( const SwRect& rRect );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-04-18 22:25:24 +02:00
|
|
|
// From holes to areas, from areas to holes.
|
2000-09-18 16:15:01 +00:00
|
|
|
void Invert();
|
2011-04-18 22:25:24 +02:00
|
|
|
|
|
|
|
// Combine adjacent rectangles.
|
2012-07-20 12:08:29 +02:00
|
|
|
void Compress( bool bFuzzy = true );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
inline const SwRect &GetOrigin() const { return aOrigin; }
|
|
|
|
inline void ChangeOrigin( const SwRect &rRect ) { aOrigin = rRect; }
|
|
|
|
};
|
|
|
|
|
2013-11-05 02:17:53 +01:00
|
|
|
#endif // INCLUDED_SW_INC_SWREGION_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|