diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-01-07 10:03:01 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-01-07 10:03:01 +0100 |
commit | b06a3287f38af15af2172e20f2ad29a0d12cd8ff (patch) | |
tree | 7a117e490a5d05e5fac8cc6cd945b6fe3f83a396 | |
parent | 28750c30fb5dac69c63b6b7bfd0d9b0264b91d57 (diff) |
dba34c: #i116032# we have to recalc the bounding rect
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 04222d6e2f1e..6aa29551bcbf 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -544,22 +544,22 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) else { uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition(); + const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); + const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); + const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width; + if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN ) { - const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); m_pPage->SetLftBorder(nLeftMargin); } else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN ) { - const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); m_pPage->SetRgtBorder(nRightMargin); } try { - const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); - const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); - const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width; + sal_Int32 nRightBorder = nPaperWidth - nRightMargin; const sal_Int32 nCount = m_xSection->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) { @@ -578,9 +578,9 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) aPos.X = nLeftMargin; bChanged = true; } - if ( (aPos.X + aSize.Width) > (nPaperWidth - nRightMargin) ) + if ( (aPos.X + aSize.Width) > nRightBorder ) { - aPos.X = nPaperWidth - nRightMargin - aSize.Width; + aPos.X = nRightBorder - aSize.Width; if ( aPos.X < nLeftMargin ) { aSize.Width += aPos.X - nLeftMargin; @@ -603,6 +603,8 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) aRet.setWidth(aRet.getWidth() + 1); if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) ) m_xSection->setHeight(aRet.getHeight() + aRet.Top()); + + pObject->RecalcBoundRect(); } pBase->StartListening(); } |