summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-03-23 11:58:14 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-03-23 11:58:14 +0100
commit52cc8fded55d1761c6913a3704a03a7c137a7f3d (patch)
tree23bcfa21fc85e6476547f3eb518eb6e6672eb3fe /reportdesign
parent53dcfad04091ad92554efc9eaf7c98653c4575ac (diff)
parentc73b3e8ea9e6c394d9c5c0f5cd38d010e6f6e631 (diff)
CWS-TOOLING: integrate CWS autorecovery
Notes
Notes: split repo tag: base_ooo/DEV300_m76
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/core/sdr/RptObject.cxx1
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx7
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx15
-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
15 files changed, 332 insertions, 273 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index e91f52d14484..d932110bc5f3 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -311,6 +311,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 0c9bb751583f..bcc90b54b8b6 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -622,6 +622,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)
@@ -639,6 +640,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)
@@ -801,55 +803,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)
{
@@ -1945,6 +1953,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);
@@ -1956,6 +1996,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/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 735468ad0d83..2299fff10f98 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -667,6 +667,7 @@ void OUnoObject::impl_initializeModel_nothrow()
const Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW );
const ::rtl::OUString sTreatAsNumberProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TreatAsNumber" ) );
xModelProps->setPropertyValue( sTreatAsNumberProperty, makeAny( sal_False ) );
+ xModelProps->setPropertyValue( PROPERTY_VERTICALALIGN,m_xReportComponent->getPropertyValue(PROPERTY_VERTICALALIGN));
}
}
catch( const Exception& )
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 097cc30cd9c0..2c946d5280da 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1114,6 +1114,13 @@ sal_Bool ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDef
::rtl::OUString sExpression = xGroup->getExpression();
if ( sExpression.getLength() )
{
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ sal_Int32 nIndex = sExpression.indexOf('"');
+ while ( nIndex > -1 )
+ {
+ sExpression = sExpression.replaceAt(nIndex,1,s_sQuote);
+ nIndex = sExpression.indexOf('"',nIndex+2);
+ }
::rtl::OUString sFormula(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
TGroupFunctionMap::iterator aGroupFind = m_aGroupFunctionMap.find(xGroup);
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 9fb6b4239e76..e6c001a9ce62 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -102,6 +102,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
sal_Int32 nLen = sValue.getLength();
if ( nLen )
{
+
const static ::rtl::OUString s_sChanged(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
sal_Int32 nPos = sValue.indexOf(s_sChanged);
if ( nPos == -1 )
@@ -109,7 +110,15 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
else
{
nPos = s_sChanged.getLength();
- --nLen;
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ static ::rtl::OUString s_sSingleQuote(RTL_CONSTASCII_USTRINGPARAM("\""));
+ sal_Int32 nIndex = sValue.indexOf(s_sQuote,nPos);
+ while ( nIndex > -1 )
+ {
+ sValue = sValue.replaceAt(nIndex,2,s_sSingleQuote);
+ nIndex = sValue.indexOf(s_sQuote,nIndex+2);
+ }
+ nLen = sValue.getLength() - 1;
}
sValue = sValue.copy(nPos,nLen-nPos-1);
const ORptFilter::TGroupFunctionMap& aFunctions = _rImport.getFunctions();
@@ -139,8 +148,8 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
{
nGroupOn = report::GroupOn::MONTH;
}
- else if ( sCompleteFormula.matchAsciiL("rpt:INT((MONTH",sizeof("rpt:INT((MONTH"),0)
- && sCompleteFormula.endsWithIgnoreAsciiCaseAsciiL("-1)/3)+1",sizeof("-1)/3)+1")) )
+ else if ( sCompleteFormula.matchIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:INT((MONTH")),0)
+ && sCompleteFormula.endsWithIgnoreAsciiCaseAsciiL("-1)/3)+1",8) )
{
nGroupOn = report::GroupOn::QUARTAL;
}
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index ea899d3f69f1..4da25a831607 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -142,7 +142,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -168,7 +168,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 924c1f70e814..761e07c13773 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -60,6 +60,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>
@@ -70,7 +71,6 @@ class TransferableClipboardListener;
class VclWindowEvent;
namespace rptui
{
- class ODesignView;
class OGroupsSortingDialog;
class OPropertyMediator;
class OReportModel;
@@ -98,7 +98,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
@@ -106,6 +105,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;
@@ -349,7 +350,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 3beaa8382d3b..4267bc0ef6e4 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -99,7 +99,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -116,7 +116,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 e6ad2b4d2851..d5080e56d28d 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -111,7 +111,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -128,7 +128,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 daaefd9363d1..13b8566933c6 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -223,7 +223,7 @@ namespace rptui
*
* \return <TRUE/> if paste is allowed
*/
- BOOL IsPasteAllowed();
+ BOOL IsPasteAllowed() const;
/** paste a new control in this section
*/
@@ -240,7 +240,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 af1a12d92f58..37a67f99eb63 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -401,13 +401,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 fe6c10af0418..0b058d558f79 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -291,27 +291,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);
@@ -366,11 +365,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();
}
@@ -398,10 +400,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
@@ -462,13 +463,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();
@@ -482,7 +483,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();
@@ -502,7 +503,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();
@@ -524,27 +525,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;
@@ -570,10 +571,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();
}
@@ -600,32 +601,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:
@@ -760,12 +761,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;
@@ -780,7 +781,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();
@@ -797,12 +798,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&)
@@ -890,15 +891,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()
@@ -910,13 +911,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:
@@ -1063,7 +1064,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));
@@ -1125,13 +1126,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:
{
@@ -1141,18 +1142,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();
}
@@ -1203,19 +1204,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:
@@ -1227,38 +1228,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;
@@ -1381,7 +1382,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;
@@ -1413,24 +1414,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() )
{
@@ -1438,14 +1439,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:
@@ -1466,7 +1467,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 );
@@ -1482,7 +1483,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)
@@ -1559,7 +1560,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)
{
@@ -1588,7 +1589,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 );
@@ -1601,7 +1602,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
@@ -1737,11 +1738,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 )
{
@@ -1758,16 +1759,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 )
@@ -1793,7 +1794,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() )
@@ -1822,9 +1823,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() );
@@ -2123,17 +2124,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( )
@@ -2247,51 +2249,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 )
@@ -2301,8 +2303,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 ) )
@@ -2368,7 +2370,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;
@@ -2385,11 +2387,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);
}
}
}
@@ -2604,7 +2606,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;
@@ -2615,23 +2617,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 );
}
@@ -2640,7 +2632,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 );
}
@@ -2779,10 +2771,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());
@@ -2800,7 +2792,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();
@@ -2808,7 +2800,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"));
@@ -2917,10 +2909,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;
}
@@ -3039,7 +3031,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 );
@@ -3084,17 +3076,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
{
@@ -3102,17 +3094,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();
@@ -3124,11 +3116,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;
}
@@ -3163,8 +3155,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;
@@ -3183,7 +3175,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);
@@ -3205,7 +3197,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(),
@@ -3277,7 +3269,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);
@@ -3305,7 +3297,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);
@@ -3337,21 +3329,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
@@ -3372,8 +3364,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));
@@ -3388,7 +3380,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
@@ -3396,7 +3388,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;
@@ -3493,19 +3485,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];
@@ -3661,7 +3653,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;
@@ -3740,12 +3732,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());
}
@@ -3764,14 +3756,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)
@@ -3779,18 +3771,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());
}
@@ -3978,7 +3970,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);
@@ -3987,10 +3979,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
@@ -3998,8 +3990,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()));
}
@@ -4007,7 +3999,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();
@@ -4021,8 +4013,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());
}
}
}
@@ -4138,7 +4130,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 )
{
@@ -4171,10 +4163,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);
}
@@ -4215,7 +4207,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)
@@ -4235,15 +4227,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?
@@ -4292,7 +4284,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 27cfabd3977b..3a2f4559b43a 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -261,7 +261,7 @@ void OReportWindow::notifySizeChanged()
m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
}
//----------------------------------------------------------------------------
-BOOL OReportWindow::HasSelection()
+BOOL OReportWindow::HasSelection() const
{
return m_aViewsWindow.HasSelection();
}
@@ -284,7 +284,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 51e02c168fee..b6ab83e24a64 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -238,7 +238,7 @@ void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode )
m_aReportWindow.SetMode(_eNewMode);
}
//------------------------------------------------------------------------------
-BOOL OScrollWindowHelper::HasSelection()
+BOOL OScrollWindowHelper::HasSelection() const
{
return m_aReportWindow.HasSelection();
}
@@ -258,7 +258,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 b8899c3919f7..bcd50236aab3 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -382,10 +382,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;
@@ -512,9 +512,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());
}
//-----------------------------------------------------------------------------