summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-01-29 12:48:54 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-01-29 12:48:54 +0000
commit4450ff85181ab4e7394448d6dfe404c346bf7a6c (patch)
tree4e8d1c04b8aedf75e7f5d54878e8d3a1e1621e91 /reportdesign
parente58b07014301482b6a61bd9ec86d21c92794c76f (diff)
INTEGRATION: CWS reportdesign02 (1.2.44); FILE MERGED
2007/10/30 06:56:28 oj 1.2.44.1: #i78939# change pos and size when control is outside page
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/inc/Tools.hxx29
-rw-r--r--reportdesign/source/ui/inc/UITools.hxx14
2 files changed, 36 insertions, 7 deletions
diff --git a/reportdesign/source/core/inc/Tools.hxx b/reportdesign/source/core/inc/Tools.hxx
index 3fdd69c35..6f8e3f860 100644
--- a/reportdesign/source/core/inc/Tools.hxx
+++ b/reportdesign/source/core/inc/Tools.hxx
@@ -6,9 +6,9 @@
*
* $RCSfile: Tools.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ * last change: $Author: rt $ $Date: 2008-01-29 13:44:34 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -106,9 +106,16 @@ namespace reportdesign
public:
template<typename T> static void setSize(const ::com::sun::star::awt::Size& aSize,T* _pShape)
{
+ OSL_ENSURE(aSize.Width > 0 && aSize.Height > 0,"Illegal with or height!");
+
::osl::MutexGuard aGuard(_pShape->m_aMutex);
if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ {
+ ::com::sun::star::awt::Size aOldSize = _pShape->m_aProps.aComponent.m_xShape->getSize();
+ _pShape->m_aProps.aComponent.m_nWidth = aOldSize.Width;
+ _pShape->m_aProps.aComponent.m_nHeight = aOldSize.Height;
_pShape->m_aProps.aComponent.m_xShape->setSize(aSize);
+ }
_pShape->set(PROPERTY_WIDTH,aSize.Width,_pShape->m_aProps.aComponent.m_nWidth);
_pShape->set(PROPERTY_HEIGHT,aSize.Height,_pShape->m_aProps.aComponent.m_nHeight);
}
@@ -116,15 +123,25 @@ namespace reportdesign
{
::osl::MutexGuard aGuard(_pShape->m_aMutex);
if ( _pShape->m_aProps.aComponent.m_xShape.is() )
- return _pShape->m_aProps.aComponent.m_xShape->getSize();
+ {
+ ::com::sun::star::awt::Size aSize = _pShape->m_aProps.aComponent.m_xShape->getSize();
+ OSL_ENSURE(aSize.Width > 0 && aSize.Height > 0,"Illegal with or height!");
+ return aSize;
+ }
return ::com::sun::star::awt::Size(_pShape->m_aProps.aComponent.m_nWidth,_pShape->m_aProps.aComponent.m_nHeight);
}
template<typename T> static void setPosition( const ::com::sun::star::awt::Point& aPosition ,T* _pShape)
{
+ OSL_ENSURE(aPosition.X >= 0 && aPosition.Y >= 0,"Illegal position!");
::osl::MutexGuard aGuard(_pShape->m_aMutex);
if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ {
+ ::com::sun::star::awt::Point aOldPos = _pShape->m_aProps.aComponent.m_xShape->getPosition();
+ _pShape->m_aProps.aComponent.m_nPosX = aOldPos.X;
+ _pShape->m_aProps.aComponent.m_nPosY = aOldPos.Y;
_pShape->m_aProps.aComponent.m_xShape->setPosition(aPosition);
+ }
_pShape->set(PROPERTY_POSITIONX,aPosition.X,_pShape->m_aProps.aComponent.m_nPosX);
_pShape->set(PROPERTY_POSITIONY,aPosition.Y,_pShape->m_aProps.aComponent.m_nPosY);
}
@@ -132,7 +149,11 @@ namespace reportdesign
{
::osl::MutexGuard aGuard(_pShape->m_aMutex);
if ( _pShape->m_aProps.aComponent.m_xShape.is() )
- return _pShape->m_aProps.aComponent.m_xShape->getPosition();
+ {
+ ::com::sun::star::awt::Point aPosition = _pShape->m_aProps.aComponent.m_xShape->getPosition();
+ OSL_ENSURE(aPosition.X >= 0 && aPosition.Y >= 0,"Illegal position!");
+ return aPosition;
+ }
return ::com::sun::star::awt::Point(_pShape->m_aProps.aComponent.m_nPosX,_pShape->m_aProps.aComponent.m_nPosY);
}
template<typename T> static void setParent( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& Parent, T* _pShape)
diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx
index 56b3e0ffd..5896507a0 100644
--- a/reportdesign/source/ui/inc/UITools.hxx
+++ b/reportdesign/source/ui/inc/UITools.hxx
@@ -6,9 +6,9 @@
*
* $RCSfile: UITools.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ * last change: $Author: rt $ $Date: 2008-01-29 13:48:54 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -43,7 +43,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
-
+#include "ReportSection.hxx"
#include <rtl/ref.hxx>
#include <vcl/taskpanelist.hxx>
#include <comphelper/stl_types.hxx>
@@ -152,6 +152,14 @@ namespace rptui
*/
::com::sun::star::uno::Sequence< ::rtl::OUString >
getParameterNames( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet );
+
+ /** ensures that no control overlaps the given one.
+ *
+ * \param pControl the control which should place in the section without overlapping
+ * \param _pReportSection the section
+ * \param _bInsert TRUE whe the control should be inserted, otherwise not.
+ */
+ void correctOverlapping(SdrObject* pControl,::boost::shared_ptr<OReportSection> _pReportSection,bool _bInsert = true);
}
#endif //RPTUI_UITOOLS_HXX