summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-19 13:52:10 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-19 13:52:10 +0100
commiteb03a387b1a95b8b4e5eea60c2b7c9c40d71597b (patch)
tree339352b2da9ebbccf19f05664010c954ca218c37 /reportdesign
parentade45fff47747bf3774b49d923b37ce9a02a178f (diff)
parentf134b69089fb4f37f987b28e08f1b9aa48311926 (diff)
Automated merge with ssh://hg@hg.services.openoffice.org/cws/dba33e
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/ReportDefinition.hxx5
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx138
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx4
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx7
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx4
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx4
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx4
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx394
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx4
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx4
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx10
12 files changed, 312 insertions, 270 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index ec9a5c4f5248..6048ab1d6625 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -314,6 +314,11 @@ namespace reportdesign
virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMapUnit( ::sal_Int64 nAspect ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ // XModifiable2
+ virtual ::sal_Bool SAL_CALL disableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL enableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ) throw (::com::sun::star::uno::RuntimeException);
+
// XModifiable
virtual ::sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setModified( ::sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index b505f16ff751..a05e368fbef8 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -625,6 +625,7 @@ struct OReportDefinitionImpl
sal_Bool m_bControllersLocked;
sal_Bool m_bModified;
sal_Bool m_bEscapeProcessing;
+ sal_Bool m_bSetModifiedEnabled;
OReportDefinitionImpl(::osl::Mutex& _aMutex)
:m_aStorageChangeListeners(_aMutex)
,m_aCloseListener(_aMutex)
@@ -642,6 +643,7 @@ struct OReportDefinitionImpl
,m_bControllersLocked(sal_False)
,m_bModified(sal_False)
,m_bEscapeProcessing(sal_True)
+ ,m_bSetModifiedEnabled( sal_True )
{}
OReportDefinitionImpl(::osl::Mutex& _aMutex,const OReportDefinitionImpl& _aCopy)
@@ -804,55 +806,61 @@ void SAL_CALL OReportDefinition::dispose() throw(uno::RuntimeException)
// -----------------------------------------------------------------------------
void SAL_CALL OReportDefinition::disposing()
{
- m_pImpl->m_aControllers.clear();
+ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
+
uno::Reference< frame::XModel > xHoldAlive( this );
- {
- notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
-
- lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
- m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
- m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
-
- ::comphelper::disposeComponent(m_pImpl->m_xGroups);
- m_pImpl->m_xReportHeader.clear();
- m_pImpl->m_xReportFooter.clear();
- m_pImpl->m_xPageHeader.clear();
- m_pImpl->m_xPageFooter.clear();
- m_pImpl->m_xDetail.clear();
- //::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
- //::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
- //::comphelper::disposeComponent(m_pImpl->m_xPageHeader);
- //::comphelper::disposeComponent(m_pImpl->m_xPageFooter);
- //::comphelper::disposeComponent(m_pImpl->m_xDetail);
- ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
-
- //::comphelper::disposeComponent(m_pImpl->m_xStorage);
- // don't dispose, this currently is the task of either the ref count going to
- // 0, or of the embedded object (if we're embedded, which is the only possible
- // case so far)
- // #i78366# / 2007-06-18 / frank.schoenheit@sun.com
- m_pImpl->m_xStorage.clear();
- m_pImpl->m_xViewData.clear();
- m_pImpl->m_xCurrentController.clear();
- m_pImpl->m_xNumberFormatsSupplier.clear();
- m_pImpl->m_xStyles.clear();
- m_pImpl->m_xXMLNamespaceMap.clear();
- m_pImpl->m_xGradientTable.clear();
- m_pImpl->m_xHatchTable.clear();
- m_pImpl->m_xBitmapTable.clear();
- m_pImpl->m_xTransparencyGradientTable.clear();
- m_pImpl->m_xDashTable.clear();
- m_pImpl->m_xMarkerTable.clear();
- m_pImpl->m_xUIConfigurationManager.clear();
- m_pImpl->m_pReportModel.reset();
- m_pImpl->m_pObjectContainer.reset();
- m_pImpl->m_aArgs.realloc(0);
- m_pImpl->m_xTitleHelper.clear();
- m_pImpl->m_xNumberedControllers.clear();
- }
+
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
+
+ // SYNCHRONIZED --->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+
+ m_pImpl->m_aControllers.clear();
+
+ ::comphelper::disposeComponent(m_pImpl->m_xGroups);
+ m_pImpl->m_xReportHeader.clear();
+ m_pImpl->m_xReportFooter.clear();
+ m_pImpl->m_xPageHeader.clear();
+ m_pImpl->m_xPageFooter.clear();
+ m_pImpl->m_xDetail.clear();
+ //::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
+ //::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
+ //::comphelper::disposeComponent(m_pImpl->m_xPageHeader);
+ //::comphelper::disposeComponent(m_pImpl->m_xPageFooter);
+ //::comphelper::disposeComponent(m_pImpl->m_xDetail);
+ ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
+
+ //::comphelper::disposeComponent(m_pImpl->m_xStorage);
+ // don't dispose, this currently is the task of either the ref count going to
+ // 0, or of the embedded object (if we're embedded, which is the only possible
+ // case so far)
+ // #i78366# / 2007-06-18 / frank.schoenheit@sun.com
+ m_pImpl->m_xStorage.clear();
+ m_pImpl->m_xViewData.clear();
+ m_pImpl->m_xCurrentController.clear();
+ m_pImpl->m_xNumberFormatsSupplier.clear();
+ m_pImpl->m_xStyles.clear();
+ m_pImpl->m_xXMLNamespaceMap.clear();
+ m_pImpl->m_xGradientTable.clear();
+ m_pImpl->m_xHatchTable.clear();
+ m_pImpl->m_xBitmapTable.clear();
+ m_pImpl->m_xTransparencyGradientTable.clear();
+ m_pImpl->m_xDashTable.clear();
+ m_pImpl->m_xMarkerTable.clear();
+ m_pImpl->m_xUIConfigurationManager.clear();
+ m_pImpl->m_pReportModel.reset();
+ m_pImpl->m_pObjectContainer.reset();
+ m_pImpl->m_aArgs.realloc(0);
+ m_pImpl->m_xTitleHelper.clear();
+ m_pImpl->m_xNumberedControllers.clear();
+ // <--- SYNCHRONIZED
}
+
// -----------------------------------------------------------------------------
::rtl::OUString OReportDefinition::getImplementationName_Static( ) throw(uno::RuntimeException)
{
@@ -1948,6 +1956,38 @@ embed::VisualRepresentation SAL_CALL OReportDefinition::getPreferredVisualRepres
}
// -----------------------------------------------------------------------------
// XModifiable
+::sal_Bool SAL_CALL OReportDefinition::disableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_False;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::enableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_True;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::isSetModifiedEnabled( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ return m_pImpl->m_bSetModifiedEnabled;
+}
+
+// -----------------------------------------------------------------------------
+// XModifiable
::sal_Bool SAL_CALL OReportDefinition::isModified( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
@@ -1959,6 +1999,10 @@ void SAL_CALL OReportDefinition::setModified( ::sal_Bool _bModified ) throw (bea
{
::osl::ResettableMutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ if ( !m_pImpl->m_bSetModifiedEnabled )
+ return;
+
if ( m_pImpl->m_pReportModel->IsReadOnly() && _bModified )
throw beans::PropertyVetoException();
if ( m_pImpl->m_bModified != _bModified )
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index 07167df69ae4..ec252103b90a 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -145,7 +145,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -171,7 +171,7 @@ namespace rptui
void SelectAll(const sal_uInt16 _nObjectType);
/// checks if a selection exists
- BOOL HasSelection();
+ BOOL HasSelection() const;
void UpdatePropertyBrowserDelayed(OSectionView& _rView);
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index 03ccda9d2209..0f440997bd52 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -63,6 +63,7 @@
#include <comphelper/propertystatecontainer.hxx>
#include "RptDef.hxx"
+#include "DesignView.hxx"
#include <functional>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/util/XModeSelector.hpp>
@@ -73,7 +74,6 @@ class TransferableClipboardListener;
class VclWindowEvent;
namespace rptui
{
- class ODesignView;
class OGroupsSortingDialog;
class OPropertyMediator;
class OReportModel;
@@ -101,7 +101,6 @@ namespace rptui
m_aSelectionListeners;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
m_aCollapsedSections;
- ODesignView* m_pMyOwnView; // we want to avoid casts
TransferableDataHelper m_aSystemClipboard; // content of the clipboard
TransferableClipboardListener*
m_pClipbordNotifier; /// notifier for changes in the clipboard
@@ -109,6 +108,8 @@ namespace rptui
OXReportControllerObserver* m_pReportControllerObserver;
+ ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); }
+
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> m_xReportDefinition;
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine> m_xReportEngine;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XComponentLoader> m_xFrameLoader;
@@ -352,7 +353,7 @@ namespace rptui
// SfxListener
virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
- virtual void setModified(sal_Bool _bModified=sal_True);
+ virtual void impl_onModifyChanged();
// const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();}
// need for undo's and redo's
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
index fcf274d314e4..3638e0e85ad9 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -102,7 +102,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -119,7 +119,7 @@ namespace rptui
/** returns <TRUE/> when a object is marked
*/
- BOOL HasSelection();
+ BOOL HasSelection() const;
Point getThumbPos() const;
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
index 6098c7bbb2e1..712e6178edfc 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -114,7 +114,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -131,7 +131,7 @@ namespace rptui
/** returns <TRUE/> when a object is marked
*/
- BOOL HasSelection();
+ BOOL HasSelection() const;
/** removes the section at the given position.
*
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index b9fd640b307e..f65fa1ad932d 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -226,7 +226,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -243,7 +243,7 @@ namespace rptui
/** returns <TRUE/> when a object is marked
*/
- BOOL HasSelection();
+ BOOL HasSelection() const;
/** unmark all objects on the views without the given one.
*
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index 3709d8f6cf16..6c70be42fefd 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -404,13 +404,13 @@ void ODesignView::Delete()
m_aScrollWindow.Delete();
}
//----------------------------------------------------------------------------
-BOOL ODesignView::HasSelection()
+BOOL ODesignView::HasSelection() const
{
return m_aScrollWindow.HasSelection();
}
//----------------------------------------------------------------------------
-BOOL ODesignView::IsPasteAllowed()
+BOOL ODesignView::IsPasteAllowed() const
{
return m_aScrollWindow.IsPasteAllowed();
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 817f88adf3cb..741fb4db5fe0 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -294,27 +294,26 @@ Reference< XInterface > OReportController::create(Reference< XComponentContext >
DBG_NAME( rpt_OReportController )
// -----------------------------------------------------------------------------
OReportController::OReportController(Reference< XComponentContext > const & xContext)
-: OReportController_BASE(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY))
-,OPropertyStateContainer(OGenericUnoController_Base::rBHelper)
-,m_aSelectionListeners( getMutex() )
-,m_pMyOwnView(NULL)
-,m_pClipbordNotifier(NULL)
-,m_pGroupsFloater(NULL)
-,m_xContext(xContext)
-,m_nSplitPos(-1)
-,m_nPageNum(-1)
-,m_nSelectionCount(0)
-,m_nZoomValue(100)
-,m_eZoomType(SVX_ZOOM_PERCENT)
-,m_bShowRuler(sal_True)
-,m_bGridVisible(sal_True)
-,m_bGridUse(sal_True)
-,m_bShowProperties(sal_True)
-,m_bGroupFloaterWasVisible(sal_False)
-,m_bHelplinesMove(sal_True)
-,m_bChartEnabled(false)
-,m_bChartEnabledAsked(false)
-,m_bInGeneratePreview(false)
+ :OReportController_BASE(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY))
+ ,OPropertyStateContainer(OGenericUnoController_Base::rBHelper)
+ ,m_aSelectionListeners( getMutex() )
+ ,m_pClipbordNotifier(NULL)
+ ,m_pGroupsFloater(NULL)
+ ,m_xContext(xContext)
+ ,m_nSplitPos(-1)
+ ,m_nPageNum(-1)
+ ,m_nSelectionCount(0)
+ ,m_nZoomValue(100)
+ ,m_eZoomType(SVX_ZOOM_PERCENT)
+ ,m_bShowRuler(sal_True)
+ ,m_bGridVisible(sal_True)
+ ,m_bGridUse(sal_True)
+ ,m_bShowProperties(sal_True)
+ ,m_bGroupFloaterWasVisible(sal_False)
+ ,m_bHelplinesMove(sal_True)
+ ,m_bChartEnabled(false)
+ ,m_bChartEnabledAsked(false)
+ ,m_bInGeneratePreview(false)
{
// new Observer
m_pReportControllerObserver = new OXReportControllerObserver(*this);
@@ -369,11 +368,14 @@ void OReportController::disposing()
{
try
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow;
+ if ( getDesignView() )
+ pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
pSectionWindow->getReportSection().deactivateOle();
getUndoMgr()->Clear(); // clear all undo redo things
- listen(false);
+ if ( m_aReportModel )
+ listen(false);
m_pReportControllerObserver->Clear();
m_pReportControllerObserver->release();
}
@@ -401,10 +403,9 @@ void OReportController::disposing()
catch(uno::Exception&)
{
}
- if ( m_pMyOwnView )
- EndListening(*(m_pMyOwnView));
- m_pView = NULL;
- m_pMyOwnView = NULL;
+ if ( getDesignView() )
+ EndListening( *getDesignView() );
+ clearView();
}
// -----------------------------------------------------------------------------
FeatureState OReportController::GetState(sal_uInt16 _nId) const
@@ -465,13 +466,13 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_OBJECT_SMALLESTHEIGHT:
case SID_OBJECT_GREATESTWIDTH:
case SID_OBJECT_GREATESTHEIGHT:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();// && m_pMyOwnView->isAlignPossible();
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible();
if ( aReturn.bEnabled )
aReturn.bEnabled = m_nSelectionCount > 1;
break;
case SID_DISTRIBUTION:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
if ( aReturn.bEnabled )
{
OSectionView* pSectionView = getCurrentSectionView();
@@ -485,7 +486,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_FRAME_TO_BOTTOM:
case SID_OBJECT_HEAVEN:
case SID_OBJECT_HELL:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
if ( aReturn.bEnabled )
{
OSectionView* pSectionView = getCurrentSectionView();
@@ -505,7 +506,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_SECTION_SHRINK_BOTTOM:
{
sal_Int32 nCount = 0;
- uno::Reference<report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
if ( xSection.is() )
{
nCount = xSection->getCount();
@@ -527,27 +528,27 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_SECTION_ALIGN_UP:
case SID_SECTION_ALIGN_MIDDLE:
case SID_SECTION_ALIGN_DOWN:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();// && m_pMyOwnView->isAlignPossible();
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible();
break;
case SID_CUT:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
break;
case SID_COPY:
- aReturn.bEnabled = m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
break;
case SID_PASTE:
- aReturn.bEnabled = isEditable() && !m_pMyOwnView->isHandleEvent(_nId) && m_pMyOwnView->IsPasteAllowed();
+ aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId) && getDesignView()->IsPasteAllowed();
break;
case SID_SELECTALL:
- aReturn.bEnabled = !m_pMyOwnView->isHandleEvent(_nId);
+ aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
break;
case SID_SELECTALL_IN_SECTION:
- aReturn.bEnabled = !m_pMyOwnView->isHandleEvent(_nId);
+ aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
if ( aReturn.bEnabled )
aReturn.bEnabled = getCurrentSectionView() != NULL;
break;
case SID_ESCAPE:
- aReturn.bEnabled = m_pMyOwnView->GetMode() == RPTUI_INSERT;
+ aReturn.bEnabled = getDesignView()->GetMode() == RPTUI_INSERT;
break;
case SID_TERMINATE_INPLACEACTIVATION:
aReturn.bEnabled = sal_True;
@@ -573,10 +574,10 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = isConnected() && m_xReportDefinition.is();
break;
case SID_DELETE:
- aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
if ( aReturn.bEnabled )
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
aReturn.bEnabled = !pSectionWindow->getReportSection().isUiActive();
}
@@ -603,32 +604,32 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_OBJECT_SELECT:
aReturn.bEnabled = sal_True;
- aReturn.bChecked = m_pMyOwnView->GetMode() == RPTUI_SELECT;
+ aReturn.bChecked = getDesignView()->GetMode() == RPTUI_SELECT;
break;
case SID_INSERT_DIAGRAM:
aReturn.bEnabled = isEditable();
aReturn.bInvisible = optional< bool >(!m_bChartEnabled);
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_OLE2;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2;
break;
case SID_FM_FIXEDTEXT:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_FIXEDTEXT;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FIXEDTEXT;
break;
case SID_INSERT_HFIXEDLINE:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_HFIXEDLINE;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_HFIXEDLINE;
break;
case SID_INSERT_VFIXEDLINE:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_VFIXEDLINE;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_VFIXEDLINE;
break;
case SID_FM_EDIT:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD;
break;
case SID_FM_IMAGECONTROL:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_IMAGECONTROL;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_IMAGECONTROL;
break;
case SID_DRAWTBX_CS_BASIC:
case SID_DRAWTBX_CS_BASIC1:
@@ -763,12 +764,12 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_RPT_SHOWREPORTEXPLORER:
aReturn.bEnabled = m_xReportDefinition.is();
- aReturn.bChecked = m_pMyOwnView && m_pMyOwnView->isReportExplorerVisible();
+ aReturn.bChecked = getDesignView() && getDesignView()->isReportExplorerVisible();
break;
case SID_FM_ADD_FIELD:
aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
&& m_xReportDefinition->getCommand().getLength();
- aReturn.bChecked = m_pMyOwnView && m_pMyOwnView->isAddFieldVisible();
+ aReturn.bChecked = getDesignView() && getDesignView()->isAddFieldVisible();
break;
case SID_SHOW_PROPERTYBROWSER:
aReturn.bEnabled = sal_True;
@@ -783,7 +784,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.aValue <<= getSplitPos();
break;
case SID_SAVEDOC:
- aReturn.bEnabled = isModified() && isEditable();
+ aReturn.bEnabled = impl_isModified() && isEditable();
break;
case SID_SAVEASDOC:
aReturn.bEnabled = isConnected() && isEditable();
@@ -800,12 +801,12 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_ATTR_CHAR_COLOR_BACKGROUND:
aReturn.bEnabled = isEditable();
{
- uno::Reference<report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
if ( xSection.is() )
try
{
aReturn.aValue <<= xSection->getBackColor();
- const uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ const uno::Reference< report::XReportControlModel> xControlModel(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
aReturn.bEnabled = !xControlModel.is();
}
catch(beans::UnknownPropertyException&)
@@ -893,15 +894,15 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_INSERT_GRAPHIC:
- aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentSection().is();
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
break;
case SID_CHAR_DLG:
case SID_SETCONTROLDEFAULTS:
- aReturn.bEnabled = m_xReportDefinition.is() && isEditable();// && m_pMyOwnView->getCurrentControlModel().is();
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable();// && getDesignView()->getCurrentControlModel().is();
if ( aReturn.bEnabled )
{
::std::vector< uno::Reference< uno::XInterface > > aSelection;
- m_pMyOwnView->fillControlModelSelection(aSelection);
+ getDesignView()->fillControlModelSelection(aSelection);
::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
for(; aIter != aSelection.end()
&& !uno::Reference< report::XFixedLine >(*aIter,uno::UNO_QUERY).is()
@@ -913,13 +914,13 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_CONDITIONALFORMATTING:
{
- const uno::Reference< report::XFormattedField> xFormattedField(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ const uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
aReturn.bEnabled = xFormattedField.is();
}
break;
case SID_INSERT_FLD_PGNUMBER:
case SID_DATETIME:
- aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentSection().is();
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
break;
case SID_EXPORTDOC:
case SID_EXPORTDOCASPDF:
@@ -1066,7 +1067,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fun(&ODesignView::Cut));
break;
case SID_COPY:
- m_pMyOwnView->Copy();
+ getDesignView()->Copy();
break;
case SID_PASTE:
executeMethodWithUndo(RID_STR_UNDO_PASTE,::std::mem_fun(&ODesignView::Paste));
@@ -1128,13 +1129,13 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
case SID_SECTION_SHRINK_TOP:
case SID_SECTION_SHRINK:
{
- uno::Reference<report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
shrinkSection(RID_STR_UNDO_SHRINK, xSection, _nId);
}
break;
case SID_SELECTALL:
- m_pMyOwnView->SelectAll(OBJ_NONE);
+ getDesignView()->SelectAll(OBJ_NONE);
break;
case SID_SELECTALL_IN_SECTION:
{
@@ -1144,18 +1145,18 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
}
break;
case SID_ESCAPE:
- m_pMyOwnView->SetMode(RPTUI_SELECT);
+ getDesignView()->SetMode(RPTUI_SELECT);
InvalidateFeature( SID_OBJECT_SELECT );
break;
case SID_SELECT_ALL_EDITS:
- m_pMyOwnView->SelectAll(OBJ_DLG_FORMATTEDFIELD);
+ getDesignView()->SelectAll(OBJ_DLG_FORMATTEDFIELD);
break;
case SID_SELECT_ALL_LABELS:
- m_pMyOwnView->SelectAll(OBJ_DLG_FIXEDTEXT);
+ getDesignView()->SelectAll(OBJ_DLG_FIXEDTEXT);
break;
case SID_TERMINATE_INPLACEACTIVATION:
{
- ::boost::shared_ptr<OSectionWindow> pSection = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
if ( pSection )
pSection->getReportSection().deactivateOle();
}
@@ -1206,19 +1207,19 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fun(&ODesignView::Delete));
break;
case SID_GRID_USE:
- m_pMyOwnView->setGridSnap(m_bGridUse = !m_bGridUse);
+ getDesignView()->setGridSnap(m_bGridUse = !m_bGridUse);
break;
case SID_HELPLINES_MOVE:
- m_pMyOwnView->setDragStripes(m_bHelplinesMove = !m_bHelplinesMove);
+ getDesignView()->setDragStripes(m_bHelplinesMove = !m_bHelplinesMove);
break;
case SID_GRID_VISIBLE:
- m_pMyOwnView->toggleGrid(m_bGridVisible = !m_bGridVisible);
+ getDesignView()->toggleGrid(m_bGridVisible = !m_bGridVisible);
break;
case SID_RULER:
- m_pMyOwnView->showRuler(m_bShowRuler = !m_bShowRuler);
+ getDesignView()->showRuler(m_bShowRuler = !m_bShowRuler);
break;
case SID_OBJECT_SELECT:
- m_pMyOwnView->SetMode(RPTUI_SELECT);
+ getDesignView()->SetMode(RPTUI_SELECT);
InvalidateAll();
break;
case SID_INSERT_DIAGRAM:
@@ -1230,38 +1231,38 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
InsertChart(m_xContext,m_xReportDefinition.get(),xWindow,pView,getSdrModel().get());
}
}*/
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_OLE2);
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_OLE2);
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_FIXEDTEXT:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_DLG_FIXEDTEXT );
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_INSERT_HFIXEDLINE:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_DLG_HFIXEDLINE );
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_INSERT_VFIXEDLINE:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_DLG_VFIXEDLINE );
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_EDIT:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_IMAGECONTROL:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
- m_pMyOwnView->SetInsertObj( OBJ_DLG_IMAGECONTROL );
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROL );
createDefaultControl(aArgs);
InvalidateAll();
break;
@@ -1384,7 +1385,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
case SID_DRAWTBX_CS_FLOWCHART:
case SID_DRAWTBX_CS_CALLOUT:
case SID_DRAWTBX_CS_STAR:
- m_pMyOwnView->SetMode( RPTUI_INSERT );
+ getDesignView()->SetMode( RPTUI_INSERT );
{
URL aUrl = getURLForId(_nId);
sal_Int32 nIndex = 1;
@@ -1416,24 +1417,24 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
else
sType = aUrl.Complete.getToken(0,'.',nIndex);
- m_pMyOwnView->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
+ getDesignView()->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
createDefaultControl(aArgs);
}
InvalidateAll();
break;
case SID_RPT_SHOWREPORTEXPLORER:
if ( isUiVisible() )
- m_pMyOwnView->toggleReportExplorer();
+ getDesignView()->toggleReportExplorer();
break;
case SID_FM_ADD_FIELD:
if ( isUiVisible() )
- m_pMyOwnView->toggleAddField();
+ getDesignView()->toggleAddField();
break;
case SID_SHOW_PROPERTYBROWSER:
if ( m_bShowProperties )
- m_sLastActivePage = m_pMyOwnView->getCurrentPage();
+ m_sLastActivePage = getDesignView()->getCurrentPage();
else
- m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+ getDesignView()->setCurrentPage(m_sLastActivePage);
if ( isUiVisible() )
{
@@ -1441,14 +1442,14 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
if ( aArgs.getLength() == 1 )
aArgs[0].Value >>= m_bShowProperties;
- m_pMyOwnView->togglePropertyBrowser(m_bShowProperties);
+ getDesignView()->togglePropertyBrowser(m_bShowProperties);
}
break;
case SID_PROPERTYBROWSER_LAST_PAGE: // nothing to do
- m_sLastActivePage = m_pMyOwnView->getCurrentPage();
+ m_sLastActivePage = getDesignView()->getCurrentPage();
break;
case SID_SPLIT_POSITION:
- m_pMyOwnView->Resize();
+ getDesignView()->Resize();
break;
case SID_PAGEDIALOG:
case SID_ATTR_CHAR_COLOR_BACKGROUND:
@@ -1469,7 +1470,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
const util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
if ( !impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CONTROLBACKGROUND,uno::makeAny(aColor),aArgs) )
{
- uno::Reference< report::XSection > xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
if ( xSection.is() )
{
xSection->setBackColor( aColor );
@@ -1485,7 +1486,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
::std::auto_ptr<UndoManagerListAction> pListAction;
uno::Reference< awt::XWindow> xWindow;
::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
- lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow,aControlsFormats);
+ lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
bool bMulti = aControlsFormats.size() > 1;
::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin();
for(; aIter != aControlsFormats.end();++aIter)
@@ -1562,7 +1563,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
uno::Sequence< beans::NamedValue > aSettings;
uno::Reference< awt::XWindow> xWindow;
::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
- lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow,aControlsFormats);
+ lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin();
for(; aIter != aControlsFormats.end();++aIter)
{
@@ -1591,7 +1592,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
break;
case SID_CONDITIONALFORMATTING:
{
- uno::Reference< report::XFormattedField> xFormattedField(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
if ( xFormattedField.is() )
{
ConditionalFormattingDialog aDlg( getView(), xFormattedField.get(), *this );
@@ -1604,7 +1605,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- ODateTimeDialog aDlg(getView(),m_pMyOwnView->getCurrentSection(),this);
+ ODateTimeDialog aDlg(getView(),getDesignView()->getCurrentSection(),this);
aDlg.Execute();
}
else
@@ -1740,11 +1741,11 @@ void OReportController::impl_initialize( )
// check if chart is supported by the engine
checkChartEnabled();
// restore the view data
- m_pMyOwnView->toggleGrid(m_bGridVisible);
- m_pMyOwnView->showRuler(m_bShowRuler);
- m_pMyOwnView->togglePropertyBrowser(m_bShowProperties);
- m_pMyOwnView->setCurrentPage(m_sLastActivePage);
- m_pMyOwnView->unmarkAllObjects(NULL);
+ getDesignView()->toggleGrid(m_bGridVisible);
+ getDesignView()->showRuler(m_bShowRuler);
+ getDesignView()->togglePropertyBrowser(m_bShowProperties);
+ getDesignView()->setCurrentPage(m_sLastActivePage);
+ getDesignView()->unmarkAllObjects(NULL);
if ( m_nPageNum != -1 )
{
@@ -1761,16 +1762,16 @@ void OReportController::impl_initialize( )
else
m_nPageNum = -1;
}
- m_pMyOwnView->collapseSections(m_aCollapsedSections);
+ getDesignView()->collapseSections(m_aCollapsedSections);
impl_zoom_nothrow();
- m_pMyOwnView->Resize();
- m_pMyOwnView->Invalidate();
+ getDesignView()->Resize();
+ getDesignView()->Invalidate();
InvalidateAll();
if ( m_bShowProperties && m_nPageNum == -1 )
{
m_sLastActivePage = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"));
- m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+ getDesignView()->setCurrentPage(m_sLastActivePage);
uno::Sequence< beans::PropertyValue> aArgs;
executeUnChecked(SID_SELECT_REPORT,aArgs);
} // if ( m_bShowProperties && m_nPageNum == -1 )
@@ -1796,7 +1797,7 @@ IMPL_LINK( OReportController, OnOpenHelpAgent, void* ,/*_pMemfun*/)
// -----------------------------------------------------------------------------
IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow* ,_pAddFieldDlg)
{
- WaitObject aObj(m_pMyOwnView);
+ WaitObject aObj( getDesignView() );
uno::Sequence< beans::PropertyValue > aArgs = _pAddFieldDlg->getSelectedFieldDescriptors();
// we use this way to create undo actions
if ( aArgs.getLength() )
@@ -1825,9 +1826,9 @@ void OReportController::doOpenHelpAgent()
// -----------------------------------------------------------------------------
sal_Bool OReportController::Construct(Window* pParent)
{
- m_pMyOwnView = new ODesignView(pParent,getORB(),*this);
- StartListening(*(m_pMyOwnView));
- m_pView = m_pMyOwnView;
+ ODesignView* pMyOwnView = new ODesignView( pParent, getORB(), *this );
+ StartListening( *pMyOwnView );
+ setView( *pMyOwnView );
// now that we have a view we can create the clipboard listener
m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
@@ -2126,17 +2127,18 @@ SfxUndoManager* OReportController::getUndoMgr()
return &m_aUndoManager;
}
// -----------------------------------------------------------------------------
-void OReportController::setModified(sal_Bool _bModified)
+void OReportController::impl_onModifyChanged()
{
- ::osl::MutexGuard aGuard( getMutex() );
try
{
if ( m_xReportDefinition.is() )
- m_xReportDefinition->setModified(_bModified);
- OSingleDocumentController::setModified(_bModified);
+ m_xReportDefinition->setModified( impl_isModified() );
+ OSingleDocumentController::impl_onModifyChanged();
}
catch(uno::Exception)
- {}
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
// -----------------------------------------------------------------------------
void OReportController::losingConnection( )
@@ -2250,51 +2252,51 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven
const USHORT nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
if ( bShow )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition);
+ getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition);
m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportHeader());
}
else
{
- m_pMyOwnView->removeSection(nPosition);
+ getDesignView()->removeSection(nPosition);
}
}
else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) )
{
- USHORT nPosition = m_pMyOwnView->getSectionCount();
+ USHORT nPosition = getDesignView()->getSectionCount();
if ( m_xReportDefinition->getPageFooterOn() )
--nPosition;
if ( bShow )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER,nPosition);
+ getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER,nPosition);
m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportFooter());
}
else
{
- m_pMyOwnView->removeSection(nPosition - 1);
+ getDesignView()->removeSection(nPosition - 1);
}
}
else if ( evt.PropertyName.equals( PROPERTY_PAGEHEADERON ) )
{
if ( bShow )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,0);
+ getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,0);
m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageHeader());
}
else
{
- m_pMyOwnView->removeSection(USHORT(0));
+ getDesignView()->removeSection(USHORT(0));
}
}
else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) )
{
if ( bShow )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+ getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageFooter());
}
else
{
- m_pMyOwnView->removeSection(m_pMyOwnView->getSectionCount() - 1);
+ getDesignView()->removeSection(getDesignView()->getSectionCount() - 1);
}
}
else if ( evt.PropertyName.equals( PROPERTY_COMMAND )
@@ -2304,8 +2306,8 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven
)
{
InvalidateFeature(SID_FM_ADD_FIELD);
- if ( !m_pMyOwnView->isAddFieldVisible() && isUiVisible() )
- m_pMyOwnView->toggleAddField();
+ if ( !getDesignView()->isAddFieldVisible() && isUiVisible() )
+ getDesignView()->toggleAddField();
}
/// TODO: check what we need to notify here TitleHelper
/*else if ( evt.PropertyName.equals( PROPERTY_CAPTION ) )
@@ -2371,7 +2373,7 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr
{
pMemFun = ::std::mem_fun(&OGroupHelper::getFooterOn);
pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter);
- nPosition = m_pMyOwnView->getSectionCount();
+ nPosition = getDesignView()->getSectionCount();
if ( m_xReportDefinition->getPageFooterOn() )
--nPosition;
@@ -2388,11 +2390,11 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr
if ( _bShow )
{
OGroupHelper aGroupHelper(_xGroup);
- m_pMyOwnView->addSection(pMemFunSection(&aGroupHelper),sColor,nPosition);
+ getDesignView()->addSection(pMemFunSection(&aGroupHelper),sColor,nPosition);
}
else
{
- m_pMyOwnView->removeSection(nPosition);
+ getDesignView()->removeSection(nPosition);
}
}
}
@@ -2607,7 +2609,7 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi
&& (static_cast< DlgEdHint const & >(_rHint).GetKind()
== RPTUI_HINT_SELECTIONCHANGED))
{
- const sal_Int32 nSelectionCount = m_pMyOwnView->getMarkedObjectCount();
+ const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
if ( m_nSelectionCount != nSelectionCount )
{
m_nSelectionCount = nSelectionCount;
@@ -2618,23 +2620,13 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi
::boost::bind(&view::XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent)));
}
- // if (_rHint.ISA(SfxSimpleHint)
- // && (static_cast< SfxSimpleHint const & >(_rHint).GetId()
- // == SFX_HINT_COLORS_CHANGED))
- // {
- // int dummy = 0;
- // }
- // if (m_pReportControllerObserver)
- // {
- // m_pReportControllerObserver->Notify(_rBc, _rHint);
- // }
}
// -----------------------------------------------------------------------------
void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun)
{
const String sUndoAction = String((ModuleRes(_nUndoStrId)));
UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
- _pMemfun(m_pMyOwnView);
+ _pMemfun( getDesignView() );
InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
@@ -2643,7 +2635,7 @@ void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nCon
{
const String sUndoAction = String((ModuleRes(_nUndoStrId)));
UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
- m_pMyOwnView->alignMarkedObjects(_nControlModification,_bAlignAtSection);
+ getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
}
@@ -2782,10 +2774,10 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties"));
aProps[0].Value <<= aCommandProps;
- if ( m_pMyOwnView )
+ if ( getDesignView() )
{
::std::vector<sal_uInt16> aCollapsedPositions;
- m_pMyOwnView->fillCollapsedSections(aCollapsedPositions);
+ getDesignView()->fillCollapsedSections(aCollapsedPositions);
if ( !aCollapsedPositions.empty() )
{
uno::Sequence<beans::PropertyValue> aCollapsedSections(aCollapsedPositions.size());
@@ -2803,7 +2795,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
aProps[nCount].Value <<= aCollapsedSections;
}
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow.get() )
{
const sal_Int32 nCount = aProps.getLength();
@@ -2811,7 +2803,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection"));
aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum();
} // if ( pSectionWindow.get() )
- } // if ( m_pMyOwnView )
+ } // if ( getDesignView() )
const sal_Int32 nCount = aProps.getLength();
aProps.realloc( nCount + 1 );
aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor"));
@@ -2920,10 +2912,10 @@ uno::Reference<frame::XModel> OReportController::executeReport()
executeUnChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue>());
m_sLastActivePage = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"));
- m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+ getDesignView()->setCurrentPage(m_sLastActivePage);
nCommand = SID_SELECT_REPORT;
}
- else if ( m_pMyOwnView && !m_pMyOwnView->isAddFieldVisible() )
+ else if ( getDesignView() && !getDesignView()->isAddFieldVisible() )
{
nCommand = SID_FM_ADD_FIELD;
}
@@ -3042,7 +3034,7 @@ void OReportController::insertGraphic()
// build some arguments for the upcoming dialog
try
{
- uno::Reference< report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference< report::XSection> xSection = getDesignView()->getCurrentSection();
::sfx2::FileDialogHelper aDialog( ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, SFXWB_GRAPHIC );
aDialog.SetTitle( sTitle );
@@ -3087,17 +3079,17 @@ void OReportController::insertGraphic()
{
::osl::MutexGuard aGuard( getMutex() );
::sal_Bool bRet = sal_True;
- if ( m_pMyOwnView )
+ if ( getDesignView() )
{
- m_pMyOwnView->unmarkAllObjects(NULL);
- m_pMyOwnView->SetMode(RPTUI_SELECT);
+ getDesignView()->unmarkAllObjects(NULL);
+ getDesignView()->SetMode(RPTUI_SELECT);
uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
if ( aSelection >>= aElements )
{
if ( aElements.getLength() > 0 )
- m_pMyOwnView->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
- m_pMyOwnView->setMarked(aElements,sal_True);
+ getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
+ getDesignView()->setMarked(aElements,sal_True);
}
else
{
@@ -3105,17 +3097,17 @@ void OReportController::insertGraphic()
uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY);
if ( xProp.is() )
{
- m_pMyOwnView->showProperties(xObject);
+ getDesignView()->showProperties(xObject);
aElements.realloc(1);
aElements[0] = xProp;
- m_pMyOwnView->setMarked(aElements,sal_True);
+ getDesignView()->setMarked(aElements,sal_True);
}
else
{
uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
if ( !xSection.is() && xObject.is() )
- m_pMyOwnView->showProperties(xObject);
- m_pMyOwnView->setMarked(xSection,xSection.is());
+ getDesignView()->showProperties(xObject);
+ getDesignView()->setMarked(xSection,xSection.is());
}
}
InvalidateAll();
@@ -3127,11 +3119,11 @@ Any SAL_CALL OReportController::getSelection( ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( getMutex() );
Any aRet;
- if ( m_pMyOwnView )
+ if ( getDesignView() )
{
- aRet = m_pMyOwnView->getCurrentlyShownProperty();
+ aRet = getDesignView()->getCurrentlyShownProperty();
if ( !aRet.hasValue() )
- aRet <<= m_pMyOwnView->getCurrentSection();
+ aRet <<= getDesignView()->getCurrentSection();
}
return aRet;
}
@@ -3166,8 +3158,8 @@ IMPL_LINK( OReportController, OnExecuteReport, void* ,/*_pMemfun*/)
void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const ::rtl::OUString& _sFunction,sal_uInt16 _nObjectId)
{
SequenceAsHashMap aMap(_aArgs);
- m_pMyOwnView->setMarked(_xSection ,sal_True);
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection();
+ getDesignView()->setMarked(_xSection ,sal_True);
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( !pSectionWindow )
return;
@@ -3186,7 +3178,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
{
pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
- ::rtl::OUString sCustomShapeType = m_pMyOwnView->GetInsertObjString();
+ ::rtl::OUString sCustomShapeType = getDesignView()->GetInsertObjString();
if ( !sCustomShapeType.getLength() )
sCustomShapeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond"));
pSectionWindow->getReportSection().createDefault(sCustomShapeType,pNewControl);
@@ -3208,7 +3200,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
{
SdrUnoObj* pLabel( NULL );
SdrUnoObj* pControl( NULL );
- FmFormView::createControlLabelPair(m_pMyOwnView
+ FmFormView::createControlLabelPair( getDesignView()
,nLeftMargin,0
,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
NULL,pSectionWindow->getReportSection().getPage(),m_aReportModel.get(),
@@ -3280,7 +3272,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
// -----------------------------------------------------------------------------
void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
{
- m_pMyOwnView->unmarkAllObjects(NULL);
+ getDesignView()->unmarkAllObjects(NULL);
const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
@@ -3308,7 +3300,7 @@ void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
// -----------------------------------------------------------------------------
void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs)
{
- m_pMyOwnView->unmarkAllObjects(NULL);
+ getDesignView()->unmarkAllObjects(NULL);
const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
@@ -3340,21 +3332,21 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs
// -----------------------------------------------------------------------------
void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
{
- m_pMyOwnView->unmarkAllObjects(NULL);
+ getDesignView()->unmarkAllObjects(NULL);
//////////////////////////////////////////////////////////////////////
// Anhand des FormatKeys wird festgestellt, welches Feld benoetigt wird
::boost::shared_ptr<OSectionWindow> pSectionWindow[2];
- pSectionWindow[0] = m_pMyOwnView->getMarkedSection();
+ pSectionWindow[0] = getDesignView()->getMarkedSection();
if ( !pSectionWindow[0] )
{
select(uno::makeAny(m_xReportDefinition->getDetail()));
- pSectionWindow[0] = m_pMyOwnView->getMarkedSection();
+ pSectionWindow[0] = getDesignView()->getMarkedSection();
if ( !pSectionWindow[0] )
return;
}
- uno::Reference<report::XSection> xCurrentSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
try
@@ -3375,8 +3367,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
uno::Reference<report::XSection> xSection = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section")),xCurrentSection);
uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
- m_pMyOwnView->setMarked(xSection,sal_True);
- pSectionWindow[0] = m_pMyOwnView->getMarkedSection();
+ getDesignView()->setMarked(xSection,sal_True);
+ pSectionWindow[0] = getDesignView()->getMarkedSection();
sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN);
awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION,awt::Point(nLeftMargin,0));
@@ -3391,7 +3383,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINK )
{
// Add the Label one Section up
- pSectionWindow[1] = m_pMyOwnView->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST);
+ pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST);
if (!pSectionWindow[1])
{
// maybe out of bounds
@@ -3399,7 +3391,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
}
}
// clear all selections
- m_pMyOwnView->unmarkAllObjects(NULL);
+ getDesignView()->unmarkAllObjects(NULL);
uno::Reference< beans::XPropertySet > xField( aDescriptor[ ::svx::daColumnObject ], uno::UNO_QUERY );
uno::Reference< lang::XComponent > xHoldAlive;
@@ -3496,19 +3488,19 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
SdrUnoObj* pControl[2];
pControl[0] = NULL;
pControl[1] = NULL;
- //m_pMyOwnView->GetModel()->GetUndoEnv().Lock();
+ //getDesignView()->GetModel()->GetUndoEnv().Lock();
const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN);
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE).Width - nRightMargin;
OSectionView* pSectionViews[2];
pSectionViews[0] = &pSectionWindow[1]->getReportSection().getSectionView();
pSectionViews[1] = &pSectionWindow[0]->getReportSection().getSectionView();
// find this in svx
- FmFormView::createControlLabelPair(m_pMyOwnView
+ FmFormView::createControlLabelPair( getDesignView()
,nLeftMargin,0
,xField,xNumberFormats,nOBJID,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
pSectionWindow[1]->getReportSection().getPage(),pSectionWindow[0]->getReportSection().getPage(),m_aReportModel.get(),
pControl[0],pControl[1]);
- //m_pMyOwnView->GetModel()->GetUndoEnv().UnLock();
+ //getDesignView()->GetModel()->GetUndoEnv().UnLock();
if ( pControl[0] && pControl[1] )
{
SdrPageView* pPgViews[2];
@@ -3664,7 +3656,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
OSectionView* OReportController::getCurrentSectionView() const
{
OSectionView* pSectionView = NULL;
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow.get() )
pSectionView = &pSectionWindow->getReportSection().getSectionView();
return pSectionView;
@@ -3743,12 +3735,12 @@ void OReportController::listen(const bool _bAdd)
if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER);
+ getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER);
rObserver.AddSection(m_xReportDefinition->getPageHeader());
}
if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
+ getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
rObserver.AddSection(m_xReportDefinition->getReportHeader());
}
@@ -3767,14 +3759,14 @@ void OReportController::listen(const bool _bAdd)
(rUndoEnv.*pElementUndoFunction)( xGroup->getFunctions() );
if ( xGroup->getHeaderOn() && _bAdd )
{
- m_pMyOwnView->addSection(xGroup->getHeader(),DBGROUPHEADER);
+ getDesignView()->addSection(xGroup->getHeader(),DBGROUPHEADER);
rObserver.AddSection(xGroup->getHeader());
}
} // for (sal_Int32 i=0;i<nCount ; ++i)
if ( _bAdd )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getDetail(),DBDETAIL);
+ getDesignView()->addSection(m_xReportDefinition->getDetail(),DBDETAIL);
rObserver.AddSection(m_xReportDefinition->getDetail());
for (sal_Int32 i=nCount;i > 0 ; --i)
@@ -3782,18 +3774,18 @@ void OReportController::listen(const bool _bAdd)
uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i-1),uno::UNO_QUERY);
if ( xGroup->getFooterOn() )
{
- m_pMyOwnView->addSection(xGroup->getFooter(),DBGROUPFOOTER);
+ getDesignView()->addSection(xGroup->getFooter(),DBGROUPFOOTER);
rObserver.AddSection(xGroup->getFooter());
}
}
if ( m_xReportDefinition->getReportFooterOn() )
{
- m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
+ getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
rObserver.AddSection(m_xReportDefinition->getReportFooter());
}
if ( m_xReportDefinition->getPageFooterOn())
{
- m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+ getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
rObserver.AddSection(m_xReportDefinition->getPageFooter());
}
@@ -3981,7 +3973,7 @@ void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader
// -----------------------------------------------------------------------------
void OReportController::collapseSection(const bool _bCollapse)
{
- ::boost::shared_ptr<OSectionWindow> pSection = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
if ( pSection )
{
pSection->setCollapsed(_bCollapse);
@@ -3990,10 +3982,10 @@ void OReportController::collapseSection(const bool _bCollapse)
// -----------------------------------------------------------------------------
void OReportController::markSection(const bool _bNext)
{
- ::boost::shared_ptr<OSectionWindow> pSection = m_pMyOwnView->getMarkedSection();
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
if ( pSection )
{
- ::boost::shared_ptr<OSectionWindow> pPrevSection = m_pMyOwnView->getMarkedSection(_bNext ? POST : PREVIOUS);
+ ::boost::shared_ptr<OSectionWindow> pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS);
if ( pPrevSection != pSection && pPrevSection )
select(uno::makeAny(pPrevSection->getReportSection().getSection()));
else
@@ -4001,8 +3993,8 @@ void OReportController::markSection(const bool _bNext)
}
else
{
- m_pMyOwnView->markSection(_bNext ? 0 : m_pMyOwnView->getSectionCount() - 1);
- pSection = m_pMyOwnView->getMarkedSection();
+ getDesignView()->markSection(_bNext ? 0 : getDesignView()->getSectionCount() - 1);
+ pSection = getDesignView()->getMarkedSection();
if ( pSection )
select(uno::makeAny(pSection->getReportSection().getSection()));
}
@@ -4010,7 +4002,7 @@ void OReportController::markSection(const bool _bNext)
// -----------------------------------------------------------------------------
void OReportController::createDefaultControl(const uno::Sequence< beans::PropertyValue>& _aArgs)
{
- uno::Reference< report::XSection > xSection = m_pMyOwnView->getCurrentSection();
+ uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
if ( !xSection.is() )
xSection = m_xReportDefinition->getDetail();
@@ -4024,8 +4016,8 @@ void OReportController::createDefaultControl(const uno::Sequence< beans::Propert
if ( pKeyModifier == pEnd || ((pKeyModifier->Value >>= nKeyModifier) && nKeyModifier == KEY_MOD1) )
{
Sequence< PropertyValue > aCreateArgs;
- m_pMyOwnView->unmarkAllObjects(NULL);
- createControl(aCreateArgs,xSection,::rtl::OUString(),m_pMyOwnView->GetInsertObj());
+ getDesignView()->unmarkAllObjects(NULL);
+ createControl(aCreateArgs,xSection,::rtl::OUString(),getDesignView()->GetInsertObj());
}
}
}
@@ -4141,7 +4133,7 @@ void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty
if ( _rState.bEnabled )
{
::std::vector< uno::Reference< uno::XInterface > > aSelection;
- m_pMyOwnView->fillControlModelSelection(aSelection);
+ getDesignView()->fillControlModelSelection(aSelection);
_rState.bEnabled = !aSelection.empty();
if ( _rState.bEnabled )
{
@@ -4174,10 +4166,10 @@ void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty
void OReportController::impl_zoom_nothrow()
{
Fraction aZoom(m_nZoomValue,100);
- setZoomFactor(aZoom,*m_pMyOwnView);
- m_pMyOwnView->zoom(aZoom);
+ setZoomFactor( aZoom,*getDesignView() );
+ getDesignView()->zoom(aZoom);
// TRY
- /*m_pMyOwnView->Invalidate(INVALIDATE_NOCHILDREN);*/
+ /*getDesignView()->Invalidate(INVALIDATE_NOCHILDREN);*/
InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(),sal_True);
InvalidateFeature(SID_ATTR_ZOOMSLIDER,Reference< XStatusListener >(),sal_True);
}
@@ -4218,7 +4210,7 @@ bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndo
::std::auto_ptr<UndoManagerListAction> pListAction;
::std::vector< uno::Reference< uno::XInterface > > aSelection;
uno::Reference< awt::XWindow> xWindow;
- lcl_getReportControlFormat(_aArgs,m_pMyOwnView,xWindow,aSelection);
+ lcl_getReportControlFormat( _aArgs, getDesignView(), xWindow, aSelection );
const bool bMultiSet = aSelection.size() > 1;
::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
for(; aIter != aSelection.end();++aIter)
@@ -4238,15 +4230,15 @@ bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndo
void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const
{
_rState.bEnabled = isEditable();
- _rState.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE && m_pMyOwnView->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0;
+ _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0;
}
// -----------------------------------------------------------------------------
::boost::shared_ptr<OSectionWindow> OReportController::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
{
- if (m_pMyOwnView)
+ if ( getDesignView() )
{
- return m_pMyOwnView->getSectionWindow(_xSection);
+ return getDesignView()->getSectionWindow(_xSection);
}
// throw NullPointerException?
@@ -4295,7 +4287,7 @@ void OReportController::openZoomDialog()
m_eZoomType = rZoomItem.GetType();
m_nZoomValue = rZoomItem.GetValue();
if ( m_eZoomType != SVX_ZOOM_PERCENT )
- m_nZoomValue = m_pMyOwnView->getZoomFactor( m_eZoomType );
+ m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
impl_zoom_nothrow();
} // if ( !bCancel )
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index 6668e192ceff..e0de0db10d9d 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -264,7 +264,7 @@ void OReportWindow::notifySizeChanged()
m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
}
//----------------------------------------------------------------------------
-BOOL OReportWindow::HasSelection()
+BOOL OReportWindow::HasSelection() const
{
return m_aViewsWindow.HasSelection();
}
@@ -287,7 +287,7 @@ void OReportWindow::Paste()
m_aViewsWindow.Paste();
}
//----------------------------------------------------------------------------
-BOOL OReportWindow::IsPasteAllowed()
+BOOL OReportWindow::IsPasteAllowed() const
{
return m_aViewsWindow.IsPasteAllowed();
}
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index b39824d5e8ea..7eada5282607 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -241,7 +241,7 @@ void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode )
m_aReportWindow.SetMode(_eNewMode);
}
//------------------------------------------------------------------------------
-BOOL OScrollWindowHelper::HasSelection()
+BOOL OScrollWindowHelper::HasSelection() const
{
return m_aReportWindow.HasSelection();
}
@@ -261,7 +261,7 @@ void OScrollWindowHelper::Paste()
m_aReportWindow.Paste();
}
//----------------------------------------------------------------------------
-BOOL OScrollWindowHelper::IsPasteAllowed()
+BOOL OScrollWindowHelper::IsPasteAllowed() const
{
return m_aReportWindow.IsPasteAllowed();
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index e3838968de84..6c93afc0e9dc 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -385,10 +385,10 @@ void OViewsWindow::SetMode( DlgEdMode eNewMode )
::std::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper()));
}
//----------------------------------------------------------------------------
-BOOL OViewsWindow::HasSelection()
+BOOL OViewsWindow::HasSelection() const
{
- TSectionsMap::iterator aIter = m_aSections.begin();
- TSectionsMap::iterator aEnd = m_aSections.end();
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
for (;aIter != aEnd && !(*aIter)->getReportSection().getSectionView().AreObjectsMarked(); ++aIter)
;
return aIter != aEnd;
@@ -515,9 +515,9 @@ void OViewsWindow::markSection(const sal_uInt16 _nPos)
m_pParent->setMarked(m_aSections[_nPos]->getReportSection().getSection(),sal_True);
}
//----------------------------------------------------------------------------
-BOOL OViewsWindow::IsPasteAllowed()
+BOOL OViewsWindow::IsPasteAllowed() const
{
- TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(this));
+ TransferableDataHelper aTransferData( TransferableDataHelper::CreateFromSystemClipboard( const_cast< OViewsWindow* >( this ) ) );
return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId());
}
//-----------------------------------------------------------------------------