summaryrefslogtreecommitdiff
path: root/reportdesign/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-27 20:39:17 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-27 20:39:17 +0200
commit7c6061d701fb4c64ab998223fd4328435c23d994 (patch)
treec78f6e9e3e5a219443226e6d4993a0c6e4055f07 /reportdesign/source
parent3152eef8941e03eb9b25b4ad58241edc66f589df (diff)
parent2452624487700f9aa0bc385f66d7ca7818e9544d (diff)
Merge remote-tracking branch 'origin/integration/dev300_m106'
Conflicts: dbaccess/source/ui/app/makefile.mk
Diffstat (limited to 'reportdesign/source')
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx32
-rw-r--r--reportdesign/source/ui/inc/ReportSection.hxx4
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx9
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx8
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx16
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx23
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx5
-rw-r--r--reportdesign/source/ui/report/EndMarker.cxx5
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx8
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx163
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx14
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx2
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx1
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx29
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx17
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx78
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx16
17 files changed, 277 insertions, 153 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 1f6a01a50..8e2917653 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -1027,14 +1027,40 @@ void OOle2Obj::NbcMove( const Size& rSize )
// stop listening
OObjectBase::EndListening(sal_False);
+ bool bPositionFixed = false;
+ Size aUndoSize(0,0);
+ bool bUndoMode = false;
if ( m_xReportComponent.is() )
{
OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ if (pRptModel->GetUndoEnv().IsUndoMode())
+ {
+ // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
+ bUndoMode = true;
+ }
OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
- m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A());
- m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B());
+
+ // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
+ int nNewX = m_xReportComponent->getPositionX() + rSize.A();
+ // can this hinder us to set components outside the area?
+ // if (nNewX < 0)
+ // {
+ // nNewX = 0;
+ // }
+ m_xReportComponent->setPositionX(nNewX);
+ int nNewY = m_xReportComponent->getPositionY() + rSize.B();
+ if (nNewY < 0 && !bUndoMode)
+ {
+ aUndoSize.B() = abs(nNewY);
+ bPositionFixed = true;
+ nNewY = 0;
+ }
+ m_xReportComponent->setPositionY(nNewY);
+ }
+ if (bPositionFixed)
+ {
+ GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
}
-
// set geometry properties
SetPropsFromRect(GetLogicRect());
diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx
index 14293ebe3..be5ebc5ea 100644
--- a/reportdesign/source/ui/inc/ReportSection.hxx
+++ b/reportdesign/source/ui/inc/ReportSection.hxx
@@ -60,6 +60,7 @@ namespace rptui
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pMulti;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
+ sal_Int32 m_nPaintEntranceCount;
DlgEdMode m_eMode;
sal_Bool m_bDialogModelChanged;
@@ -68,6 +69,9 @@ namespace rptui
/** fills the section with all control from the report section
*/
void fill();
+ /** checks all objects if they fit in the new paper width.
+ */
+ void impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_Int32 i_nLeftMargin,sal_Int32 i_nRightMargin);
OReportSection(OReportSection&);
void operator =(OReportSection&);
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
index a53565d96..8207e2dd7 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -37,6 +37,7 @@
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <comphelper/propmultiplex.hxx>
#include <MarkedSection.hxx>
#include "ViewsWindow.hxx"
@@ -55,12 +56,16 @@ namespace rptui
class DlgEdFunc;
class DlgEdFactory;
- class OReportWindow : public Window, public IMarkedSection
+ class OReportWindow : public Window
+ , public IMarkedSection
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
{
Ruler m_aHRuler;
ODesignView* m_pView;
OScrollWindowHelper* m_pParent;
OViewsWindow m_aViewsWindow;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
::std::auto_ptr<DlgEdFactory>
m_pObjFac;
@@ -73,6 +78,8 @@ namespace rptui
void operator =(OReportWindow&);
protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
public:
OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView);
virtual ~OReportWindow();
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 6c3186288..39a722ebc 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -868,7 +868,10 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
uno::Reference< inspection::XNumericControl > xNumericControl(aOut.Control,uno::UNO_QUERY);
xNumericControl->setDecimalDigits( 2 );
xNumericControl->setValueUnit( util::MeasureUnit::MM_100TH );
- xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
+ uno::Reference< drawing::XShapeDescriptor> xShapeDesc(m_xReportComponent,uno::UNO_QUERY);
+ bool bSetMin = !xShapeDesc.is() || xShapeDesc->getShapeType() != ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
+ if ( bSetMin )
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
if ( nDisplayUnit != -1 )
xNumericControl->setDisplayUnit( nDisplayUnit );
uno::Reference< report::XReportComponent> xComp(m_xReportComponent,uno::UNO_QUERY);
@@ -886,7 +889,8 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
case PROPERTY_ID_POSITIONX:
case PROPERTY_ID_POSITIONY:
case PROPERTY_ID_WIDTH:
- xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
+ if ( bSetMin )
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
xNumericControl->setMaxValue(beans::Optional<double>(sal_True,double(aSize.Width - nLeftMargin - nRightMargin)));
if ( PROPERTY_ID_WIDTH == nId )
{
diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx
index 4b7733920..0b6f26154 100644
--- a/reportdesign/source/ui/misc/ColorListener.cxx
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -81,15 +81,21 @@ void OColorListener::DataChanged( const DataChangedEvent& rDCEvt )
// -----------------------------------------------------------------------------
void OColorListener::setCollapsed(sal_Bool _bCollapsed)
{
- m_bCollapsed = _bCollapsed;
- if ( m_aCollapsedLink.IsSet() )
- m_aCollapsedLink.Call(this);
+ if ( m_bCollapsed != _bCollapsed )
+ {
+ m_bCollapsed = _bCollapsed;
+ if ( m_aCollapsedLink.IsSet() )
+ m_aCollapsedLink.Call(this);
+ }
}
// -----------------------------------------------------------------------------
void OColorListener::setMarked(sal_Bool _bMark)
{
- m_bMarked = _bMark;
- Invalidate();
+ if ( m_bMarked != _bMark)
+ {
+ m_bMarked = _bMark;
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
}
// =======================================================================
}
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 5ef2626a9..1e2167f2e 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -869,23 +869,21 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo
{
if ( _pIgnore != pObjIter
&& (_bAllObjects || !_rView.IsObjMarked(pObjIter))
- && dynamic_cast<OUnoObject*>(pObjIter) != NULL )
+ && (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL))
{
if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
{
continue;
}
- OUnoObject* pObj = dynamic_cast<OUnoObject*>(pObjIter);
- if (pObj != NULL)
- {
-
- Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
- if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
- pOverlappedObj = pObjIter;
+ if (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL)
+ {
+ Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
+ if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ pOverlappedObj = pObjIter;
+ }
}
}
- }
return pOverlappedObj;
}
// -----------------------------------------------------------------------------
@@ -916,7 +914,7 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _
}
if ( (_bAllObjects || !_rView.IsObjMarked(pObjIter))
- && dynamic_cast<OUnoObject*>(pObjIter) != NULL )
+ && (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL) )
{
Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
@@ -930,10 +928,9 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _
SdrObject* isOver(SdrObject* _pObj,SdrPage& _rPage,SdrView& _rView,bool _bUnMarkedObjects)
{
SdrObject* pOverlappedObj = NULL;
- OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(_pObj);
- if ( pUnoObj ) // this doesn't need to be done for shapes
+ if (dynamic_cast<OUnoObject*>(_pObj) != NULL || dynamic_cast<OOle2Obj*>(_pObj) != NULL) // this doesn't need to be done for shapes
{
- Rectangle aRect = pUnoObj->GetCurrentBoundRect();
+ Rectangle aRect = _pObj->GetCurrentBoundRect();
pOverlappedObj = isOver(aRect,_rPage,_rView,_bUnMarkedObjects,_pObj);
}
return pOverlappedObj;
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index 613b016ea..255735701 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -488,11 +488,8 @@ IMPL_LINK( ODesignView, SplitHdl, void*, )
if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow.getMaxMarkerWidth(sal_False) )
{
long nOldSplitPos = getController().getSplitPos();
+ (void)nOldSplitPos;
getController().setSplitPos(nTest);
- if ( nOldSplitPos != -1 && nOldSplitPos <= nTest )
- {
- Invalidate(/*INVALIDATE_NOCHILDREN*/);
- }
}
return 0L;
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
index e0f1e90d3..2ab488c46 100644
--- a/reportdesign/source/ui/report/EndMarker.cxx
+++ b/reportdesign/source/ui/report/EndMarker.cxx
@@ -47,7 +47,6 @@ OEndMarker::OEndMarker(Window* _pParent ,const ::rtl::OUString& _sColorEntry)
DBG_CTOR( rpt_OEndMarker,NULL);
SetUniqueId(HID_RPT_ENDMARKER);
ImplInitSettings();
- SetPaintTransparent(sal_True);
}
// -----------------------------------------------------------------------------
OEndMarker::~OEndMarker()
@@ -90,6 +89,10 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ )
// -----------------------------------------------------------------------
void OEndMarker::ImplInitSettings()
{
+ EnableChildTransparentMode( sal_True );
+ SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+ SetPaintTransparent( sal_True );
+
SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor) );
SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() );
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 2ff973f65..fe0f2a188 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -108,6 +108,7 @@
#include <svx/fmview.hxx>
#include <editeng/paperinf.hxx>
+#include <editeng/memberids.hrc>
#include <svx/svxids.hrc>
#include <svx/svdobj.hxx>
#include <svx/dataaccessdescriptor.hxx>
@@ -2481,8 +2482,11 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_LRSPACE,sal_True,&pItem))
{
- xProp->setPropertyValue(PROPERTY_LEFTMARGIN,uno::makeAny((sal_Int32)static_cast<const SvxLRSpaceItem*>(pItem)->GetLeft()));
- xProp->setPropertyValue(PROPERTY_RIGHTMARGIN,uno::makeAny((sal_Int32)static_cast<const SvxLRSpaceItem*>(pItem)->GetRight()));
+ Any aValue;
+ static_cast<const SvxLRSpaceItem*>(pItem)->QueryValue(aValue,MID_L_MARGIN);
+ xProp->setPropertyValue(PROPERTY_LEFTMARGIN,aValue);
+ static_cast<const SvxLRSpaceItem*>(pItem)->QueryValue(aValue,MID_R_MARGIN);
+ xProp->setPropertyValue(PROPERTY_RIGHTMARGIN,aValue);
}
if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_ULSPACE,sal_True,&pItem))
{
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 66b5658fd..746505b38 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -96,14 +96,18 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
,m_pMulti(NULL)
,m_pReportListener(NULL)
,m_xSection(_xSection)
+,m_nPaintEntranceCount(0)
,m_eMode(RPTUI_SELECT)
,m_bDialogModelChanged(sal_False)
,m_bInDrag(sal_False)
{
DBG_CTOR( rpt_OReportSection,NULL);
- EnableChildTransparentMode();
+ //EnableChildTransparentMode();
SetHelpId(HID_REPORTSECTION);
SetMapMode( MapMode( MAP_100TH_MM ) );
+ SetParentClipMode( PARENTCLIPMODE_CLIP );
+ EnableChildTransparentMode( sal_False );
+ SetPaintTransparent( sal_False );
try
{
@@ -141,8 +145,9 @@ void OReportSection::Paint( const Rectangle& rRect )
{
Window::Paint(rRect);
- if ( m_pView )
+ if ( m_pView && m_nPaintEntranceCount == 0)
{
+ ++m_nPaintEntranceCount;
// repaint, get PageView and prepare Region
SdrPageView* pPgView = m_pView->GetSdrPageView();
const Region aPaintRectRegion(rRect);
@@ -157,10 +162,7 @@ void OReportSection::Paint( const Rectangle& rRect )
OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)");
// draw background self using wallpaper
OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice();
- sal_Int32 nColor = m_xSection->getBackColor();
- if ( nColor == (sal_Int32)COL_TRANSPARENT )
- nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
- rTargetOutDev.DrawWallpaper(rRect, Wallpaper(Color(nColor)));
+ rTargetOutDev.DrawWallpaper(rRect, Wallpaper(pPgView->GetApplicationDocumentColor()));
}
// do paint (unbuffered) and mark repaint end
@@ -171,21 +173,13 @@ void OReportSection::Paint( const Rectangle& rRect )
}
m_pView->CompleteRedraw(this,aPaintRectRegion);
+ --m_nPaintEntranceCount;
}
}
//------------------------------------------------------------------------------
void OReportSection::Resize()
{
Window::Resize();
- if ( m_xSection.is() && m_pPage && m_pView )
- {
- uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
- m_pPage->SetSize( Size( getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) );
- const Size aPageSize = m_pPage->GetSize();
- const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
- const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
- m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
- }
}
//------------------------------------------------------------------------------
void OReportSection::fill()
@@ -234,8 +228,9 @@ void OReportSection::fill()
nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
m_pView->SetApplicationDocumentColor(nColor);
- const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
- const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN);
+ 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);
m_pPage->SetLftBorder(nLeftMargin);
m_pPage->SetRgtBorder(nRightMargin);
@@ -245,15 +240,9 @@ void OReportSection::fill()
m_pView->SetDesignMode( sal_True );
m_pView->StartListening( *m_pModel );
- if ( m_xSection.is() && m_pPage && m_pView )
- {
- uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
- m_pPage->SetSize( Size( getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) );
- const Size aPageSize = m_pPage->GetSize();
- const sal_Int32 nWorkAreaLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
- const sal_Int32 nWorkAreaRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
- m_pView->SetWorkArea( Rectangle( Point( nWorkAreaLeftMargin, 0), Size(aPageSize.Width() - nWorkAreaLeftMargin - nWorkAreaRightMargin,aPageSize.Height()) ) );
- }
+ m_pPage->SetSize( Size( getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) );
+ const Size aPageSize = m_pPage->GetSize();
+ m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
}
// -----------------------------------------------------------------------------
void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce)
@@ -538,78 +527,90 @@ 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 Size aOldPageSize = m_pPage->GetSize();
+ sal_Int32 nNewHeight = 5*m_xSection->getHeight();
+ if ( aOldPageSize.Height() != nNewHeight || nPaperWidth != aOldPageSize.Width() )
{
- 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;
- const sal_Int32 nCount = m_xSection->getCount();
- for (sal_Int32 i = 0; i < nCount; ++i)
+ m_pPage->SetSize( Size( nPaperWidth,nNewHeight) );
+ const Size aPageSize = m_pPage->GetSize();
+ m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
+ }
+ impl_adjustObjectSizePosition(nPaperWidth,nLeftMargin,nRightMargin);
+ m_pParent->Invalidate(INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT);
+ }
+ }
+}
+void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_Int32 i_nLeftMargin,sal_Int32 i_nRightMargin)
+{
+ try
+ {
+ sal_Int32 nRightBorder = i_nPaperWidth - i_nRightMargin;
+ const sal_Int32 nCount = m_xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ bool bChanged = false;
+ uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW);
+ awt::Point aPos = xReportComponent->getPosition();
+ awt::Size aSize = xReportComponent->getSize();
+ SvxShape* pShape = SvxShape::getImplementation( xReportComponent );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ if ( pObject )
+ {
+ OObjectBase* pBase = dynamic_cast<OObjectBase*>(pObject);
+ pBase->EndListening(sal_False);
+ if ( aPos.X < i_nLeftMargin )
+ {
+ aPos.X = i_nLeftMargin;
+ bChanged = true;
+ }
+ if ( (aPos.X + aSize.Width) > nRightBorder )
{
- bool bChanged = false;
- uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW);
- awt::Point aPos = xReportComponent->getPosition();
- awt::Size aSize = xReportComponent->getSize();
- SvxShape* pShape = SvxShape::getImplementation( xReportComponent );
- SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
- if ( pObject )
+ aPos.X = nRightBorder - aSize.Width;
+ if ( aPos.X < i_nLeftMargin )
{
- OObjectBase* pBase = dynamic_cast<OObjectBase*>(pObject);
- pBase->EndListening(sal_False);
- if ( aPos.X < nLeftMargin )
- {
- aPos.X = nLeftMargin;
- bChanged = true;
- }
- if ( (aPos.X + aSize.Width) > (nPaperWidth - nRightMargin) )
- {
- aPos.X = nPaperWidth - nRightMargin - aSize.Width;
- if ( aPos.X < nLeftMargin )
- {
- aSize.Width += aPos.X - nLeftMargin;
- aPos.X = nLeftMargin;
- // add listener around
- pBase->StartListening();
- xReportComponent->setSize(aSize);
- pBase->EndListening(sal_False);
- }
- bChanged = true;
- }
- if ( aPos.Y < 0 )
- aPos.Y = 0;
- if ( bChanged )
- {
- xReportComponent->setPosition(aPos);
- correctOverlapping(pObject,*this,false);
- Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize()));
- aRet.setHeight(aRet.getHeight() + 1);
- 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());
- }
+ aSize.Width += aPos.X - i_nLeftMargin;
+ aPos.X = i_nLeftMargin;
+ // add listener around
pBase->StartListening();
+ xReportComponent->setSize(aSize);
+ pBase->EndListening(sal_False);
}
+ bChanged = true;
}
+ if ( aPos.Y < 0 )
+ aPos.Y = 0;
+ if ( bChanged )
+ {
+ xReportComponent->setPosition(aPos);
+ correctOverlapping(pObject,*this,false);
+ Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize()));
+ aRet.setHeight(aRet.getHeight() + 1);
+ 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();
}
- catch(uno::Exception)
- {
- OSL_FAIL("Exception caught: OReportSection::_propertyChanged(");
- }
-
- Resize();
}
}
+ catch(uno::Exception)
+ {
+ OSL_FAIL("Exception caught: OReportSection::_propertyChanged(");
+ }
}
//------------------------------------------------------------------------------
sal_Bool OReportSection::handleKeyEvent(const KeyEvent& _rEvent)
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index 41ff6abfd..680b23ac8 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -32,6 +32,7 @@
#include "ViewsWindow.hxx"
#include "ReportRuler.hxx"
#include "DesignView.hxx"
+#include "UITools.hxx"
#include <tools/debug.hxx>
#include <svtools/colorcfg.hxx>
@@ -66,6 +67,7 @@ DBG_NAME( rpt_OReportWindow )
//------------------------------------------------------------------------------
OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
: Window(_pParent,WB_DIALOGCONTROL)
+, ::comphelper::OPropertyChangeListener(m_aMutex)
,m_aHRuler(this)
,m_pView(_pView)
,m_pParent(_pParent)
@@ -89,11 +91,14 @@ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
m_aHRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
ImplInitSettings();
+ m_pReportListener = addStyleListener(_pView->getController().getReportDefinition(),this);
}
//------------------------------------------------------------------------------
OReportWindow::~OReportWindow()
{
DBG_DTOR( rpt_OReportWindow,NULL);
+ if ( m_pReportListener.is() )
+ m_pReportListener->dispose();
}
// -----------------------------------------------------------------------------
void OReportWindow::initialize()
@@ -436,6 +441,15 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
return nZoom;
}
+// -----------------------------------------------------------------------------
+void OReportWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ (void)_rEvent;
+ Resize();
+ m_aViewsWindow.Resize();
+ static sal_Int32 nIn = INVALIDATE_TRANSPARENT;
+ Invalidate(nIn);
+}
//==================================================================
} //rptui
//==================================================================
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index 9acddf5e1..caa68ef85 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -369,7 +369,7 @@ void OScrollWindowHelper::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings();
+ ImplInitSettings();
Invalidate();
}
}
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index 4ee3df033..6a04b642a 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -53,6 +53,7 @@ OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, O
,m_pSectionWindow(_pSectionWindow)
{
DBG_CTOR( rpt_OSectionView,NULL);
+ // SetPagePaintingAllowed(false);
SetBufferedOutputAllowed(true);
SetBufferedOverlayAllowed(true);
SetPageBorderVisible(false);
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 14d3c5a6b..df968e3ff 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -110,7 +110,6 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep
}
_propertyChanged(aEvent);
- SetPaintTransparent(sal_True);
}
// -----------------------------------------------------------------------------
OSectionWindow::~OSectionWindow()
@@ -136,15 +135,15 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection();
if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) )
{
+ static bool t4 = true;
+ if ( t4 )
m_pParent->getView()->SetUpdateMode(sal_False);
- Resize();
+ //Resize();
m_pParent->getView()->notifySizeChanged();
m_pParent->resize(*this);
+ if ( t4 )
m_pParent->getView()->SetUpdateMode(sal_True);
- m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
- m_aEndMarker.Invalidate(INVALIDATE_NOERASE);
- m_aReportSection.Invalidate(/*INVALIDATE_NOERASE*/);
- getViewsWindow()->getView()->getReportView()->getController().resetZoomType();
+ // getViewsWindow()->getView()->getReportView()->getController().resetZoomType();
}
else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() )
{
@@ -153,7 +152,9 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
|| setReportSectionTitle(xReport,RID_STR_REPORT_FOOTER,::std::mem_fun(&OReportHelper::getReportFooter),::std::mem_fun(&OReportHelper::getReportFooterOn))
|| setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn))
|| setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) )
+ {
m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
+ }
else
{
String sTitle = String(ModuleRes(RID_STR_DETAIL));
@@ -165,10 +166,9 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) )
{
uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY);
- if ( xGroup.is() )
+ if ( xGroup.is() && !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)))
{
- if ( !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)) )
- setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn));
+ setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn));
}
}
}
@@ -209,6 +209,13 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>&
//------------------------------------------------------------------------------
void OSectionWindow::ImplInitSettings()
{
+ static bool t = false;
+ if ( t )
+ {
+ EnableChildTransparentMode( sal_True );
+ SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+ SetPaintTransparent( sal_True );
+ }
SetBackground( );
}
//-----------------------------------------------------------------------------
@@ -304,8 +311,6 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
m_aSplitter.Show(bShow);
m_pParent->resize(*this);
- Resize();
- Invalidate();
}
return 0L;
}
@@ -397,8 +402,6 @@ void OSectionWindow::scrollChildren(long _nX)
lcl_setOrigin(m_aSplitter,_nX, 0);
lcl_scroll(m_aSplitter,aDiff);
-
- Resize();
}
//==============================================================================
} // rptui
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 34d2014e7..f4f867c39 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -70,6 +70,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol
initDefaultNodeImages();
ImplInitSettings();
m_aText.SetHelpId(HID_RPT_START_TITLE);
+ m_aText.SetPaintTransparent(sal_True);
m_aImage.SetHelpId(HID_RPT_START_IMAGE);
m_aText.Show();
m_aImage.Show();
@@ -82,7 +83,9 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol
m_aVRuler.SetMargin2();
const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
- SetPaintTransparent(sal_True);
+ EnableChildTransparentMode( sal_True );
+ SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+ SetPaintTransparent( sal_True );
}
// -----------------------------------------------------------------------------
OStartMarker::~OStartMarker()
@@ -104,20 +107,22 @@ sal_Int32 OStartMarker::getMinHeight() const
// -----------------------------------------------------------------------------
void OStartMarker::Paint( const Rectangle& rRect )
{
- Window::Paint( rRect );
+ (void)rRect;
Size aSize = GetOutputSizePixel();
long nSize = aSize.Width();
const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX());
- if ( !isCollapsed() )
+ if ( isCollapsed() )
+ {
+ SetClipRegion();
+ }
+ else
{
const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
nSize = aSize.Width() - nVRulerWidth;
- SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size( nSize,aSize.Height())))));
aSize.Width() += nCornerWidth;
+ SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height())))));
}
- else
- SetClipRegion();
const Point aGcc3WorkaroundTemporary;
Rectangle aWholeRect(aGcc3WorkaroundTemporary,aSize);
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index b2601e135..03b003d02 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -87,7 +87,7 @@ bool lcl_getNewRectSize(const Rectangle& _aObjRect,long& _nXMov, long& _nYMov,Sd
aNewRect.Move(_nXMov,_nYMov);
break;
}
- if ( dynamic_cast<OUnoObject*>(_pObj) )
+ if (dynamic_cast<OUnoObject*>(_pObj) != NULL || dynamic_cast<OOle2Obj*>(_pObj) != NULL)
{
pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj);
if ( pOverlappedObj && _pObj != pOverlappedObj )
@@ -246,8 +246,9 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow)
if ( bSet )
{
impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,bSet);
- pSectionWindow->Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
- pSectionWindow->getStartMarker().Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT );
+ static sal_Int32 nIn = INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT;
+ pSectionWindow->getStartMarker().Invalidate( nIn ); // INVALIDATE_NOERASE |INVALIDATE_NOCHILDREN| INVALIDATE_TRANSPARENT
+ pSectionWindow->getEndMarker().Invalidate( nIn );
}
}
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
@@ -258,7 +259,6 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow)
m_pParent->notifySizeChanged();
Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
- Invalidate(aRect,INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
}
//------------------------------------------------------------------------------
void OViewsWindow::Resize()
@@ -296,6 +296,7 @@ void OViewsWindow::Paint( const Rectangle& rRect )
//------------------------------------------------------------------------------
void OViewsWindow::ImplInitSettings()
{
+ EnableChildTransparentMode( sal_True );
SetBackground( );
SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
@@ -318,7 +319,6 @@ void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSectio
::boost::shared_ptr<OSectionWindow> pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) );
m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow));
m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size() == 1);
-
Resize();
}
//----------------------------------------------------------------------------
@@ -544,8 +544,8 @@ void OViewsWindow::unmarkAllObjects(OSectionView* _pSectionView)
// -----------------------------------------------------------------------
void OViewsWindow::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32)
{
- ImplInitSettings();
- Invalidate();
+ ImplInitSettings();
+ Invalidate();
}
// -----------------------------------------------------------------------------
void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt )
@@ -845,7 +845,7 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
TRectangleMap::iterator aInterSectRectIter = aSortRectangles.begin();
for (; aInterSectRectIter != aRectIter; ++aInterSectRectIter)
{
- if ( pView == aInterSectRectIter->second.second && dynamic_cast<OUnoObject*>(aInterSectRectIter->second.first) )
+ if ( pView == aInterSectRectIter->second.second && (dynamic_cast<OUnoObject*>(aInterSectRectIter->second.first) || dynamic_cast<OOle2Obj*>(aInterSectRectIter->second.first)))
{
SdrObject* pPreviousObj = aInterSectRectIter->second.first;
Rectangle aIntersectRect = aTest.GetIntersection(_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect());
@@ -921,7 +921,8 @@ void OViewsWindow::setGridSnap(sal_Bool bOn)
for (; aIter != aEnd ; ++aIter)
{
(*aIter)->getReportSection().getSectionView().SetGridSnap(bOn);
- (*aIter)->getReportSection().Invalidate();
+ static sal_Int32 nIn = 0;
+ (*aIter)->getReportSection().Invalidate(nIn);
}
}
// -----------------------------------------------------------------------------
@@ -1517,6 +1518,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
{
// restrict movement to work area
Rectangle rWorkArea = rView.GetWorkArea();
+ rWorkArea.Right()++;
if ( !rWorkArea.IsEmpty() )
{
@@ -1544,11 +1546,56 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
{
SdrMark* pMark = rMarkList.GetMark(i);
- bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL|| dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj());
}
- if ( bCheck && isOver(aMarkRect,*rReportSection.getPage(),rView) )
- break;
+
+ if ( bCheck )
+ {
+ SdrObject* pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView);
+ if ( pOverlapped )
+ {
+ do
+ {
+ Rectangle aOver = pOverlapped->GetLastBoundRect();
+ Point aPos;
+ if ( nCode == KEY_UP )
+ {
+ aPos.X() = aMarkRect.Left();
+ aPos.Y() = aOver.Top() - aMarkRect.getHeight();
+ nY += (aPos.Y() - aMarkRect.Top());
+ }
+ else if ( nCode == KEY_DOWN )
+ {
+ aPos.X() = aMarkRect.Left();
+ aPos.Y() = aOver.Bottom();
+ nY += (aPos.Y() - aMarkRect.Top());
+ }
+ else if ( nCode == KEY_LEFT )
+ {
+ aPos.X() = aOver.Left() - aMarkRect.getWidth();
+ aPos.Y() = aMarkRect.Top();
+ nX += (aPos.X() - aMarkRect.Left());
+ }
+ else if ( nCode == KEY_RIGHT )
+ {
+ aPos.X() = aOver.Right();
+ aPos.Y() = aMarkRect.Top();
+ nX += (aPos.X() - aMarkRect.Left());
+ }
+
+ aMarkRect.SetPos(aPos);
+ if ( !rWorkArea.IsInside( aMarkRect ) )
+ {
+ break;
+ }
+ pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView);
+ }
+ while(pOverlapped != NULL);
+ if (pOverlapped != NULL)
+ break;
+ }
+ }
}
if ( nX != 0 || nY != 0 )
@@ -1587,7 +1634,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
{
SdrMark* pMark = rMarkList.GetMark(i);
- bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL || dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()) != NULL;
if ( bCheck )
aNewRect.Union(pMark->GetMarkedSdrObj()->GetLastBoundRect());
}
@@ -1689,7 +1736,8 @@ void OViewsWindow::zoom(const Fraction& _aZoom)
aOut = PixelToLogic(aOut);
Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
- Invalidate(aRect,INVALIDATE_NOCHILDREN);
+ static sal_Int32 nIn = INVALIDATE_NOCHILDREN;
+ Invalidate(aRect,nIn);
}
//----------------------------------------------------------------------------
void OViewsWindow::scrollChildren(const Point& _aThumbPos)
@@ -1705,8 +1753,6 @@ void OViewsWindow::scrollChildren(const Point& _aThumbPos)
aMapMode.SetOrigin( Point(aOld.X() , - aPosY.Y()));
SetMapMode( aMapMode );
Scroll(0, -( aOld.Y() + aPosY.Y()),SCROLL_CHILDREN);
- Resize();
- Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
}
TSectionsMap::iterator aIter = m_aSections.begin();
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index 9acf262d4..0ae30f835 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -93,8 +93,12 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
aStartWidth *= m_pParent->GetMapMode().GetScaleX();
aOut.Width() -= (long)aStartWidth;
+ aOut.Height() = m_pParent->GetOutputSizePixel().Height();
- Rectangle aOutRect( pScrollWindow->getThumbPos(), aOut );
+ Point aPos = pScrollWindow->getThumbPos();
+ aPos.X() *= 0.5;
+ aPos.Y() *= 0.5;
+ Rectangle aOutRect( aPos, aOut );
aOutRect = m_pParent->PixelToLogic( aOutRect );
Point aGcc3WorkaroundTemporary;
Rectangle aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize());
@@ -438,6 +442,7 @@ void DlgEdFunc::activateOle(SdrObject* _pObj)
void DlgEdFunc::deactivateOle(bool _bSelect)
{
OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache();
+ OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
const sal_uLong nCount = rObjCache.Count();
for(sal_uLong i = 0 ; i< nCount;++i)
{
@@ -451,7 +456,6 @@ void DlgEdFunc::deactivateOle(bool _bSelect)
m_bUiActive = false;
if ( m_bShowPropertyBrowser )
{
- OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
}
@@ -603,7 +607,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
while( (pObjIter = aIter.Next()) != NULL && !bIsSetPoint)
{
if ( m_rView.IsObjMarked(pObjIter)
- && dynamic_cast<OUnoObject*>(pObjIter) != NULL )
+ && (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL) )
{
Rectangle aNewRect = pObjIter->GetLastBoundRect();
long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX();
@@ -624,15 +628,17 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
if (pObjOverlapped && !m_bSelectionMode)
{
colorizeOverlappedObject(pObjOverlapped);
+ }
}
}
}
}
- }
- else if ( aVEvt.pObj && !m_bSelectionMode)
+ else if ( aVEvt.pObj && (aVEvt.pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode)
{
colorizeOverlappedObject(aVEvt.pObj);
}
+ else
+ bIsSetPoint = false;
return bIsSetPoint;
}
// -----------------------------------------------------------------------------