diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-09 12:44:15 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-09 12:44:15 +0000 |
commit | c0dd62e6100984c61892e079fe3e1e83ba314413 (patch) | |
tree | 7180126d9af20225bb13bbdc004c75409ddc6cf2 | |
parent | a3a5c8787a80b4fb31416d656b30d0d89196e2af (diff) |
#i1000#: resolve merge conflicts from CWS frmdlg
-rw-r--r-- | reportdesign/inc/RptResId.hrc | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/AddField.cxx | 14 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/AddField.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/DesignView.hxx | 13 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/ReportController.hxx | 11 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/inspection.src | 5 | ||||
-rw-r--r-- | reportdesign/source/ui/report/DesignView.cxx | 26 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 149 |
9 files changed, 138 insertions, 94 deletions
diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc index fa775b98b..166b042db 100644 --- a/reportdesign/inc/RptResId.hrc +++ b/reportdesign/inc/RptResId.hrc @@ -263,10 +263,10 @@ #define IMG_CONDFORMAT_DLG_LCH (RID_IMAGELIST_START + 3) #define RID_SVXIMGLIST_RPTEXPL (RID_IMAGELIST_START + 4) #define RID_SVXIMGLIST_RPTEXPL_HC (RID_IMAGELIST_START + 5) -#define IMG_ADDFIELD_DLG_SC (RID_IMAGELIST_START + 6)
-#define IMG_ADDFIELD_DLG_SCH (RID_IMAGELIST_START + 7)
-#define IMG_ADDFIELD_DLG_LC (RID_IMAGELIST_START + 8)
-#define IMG_ADDFIELD_DLG_LCH (RID_IMAGELIST_START + 9)
+#define IMG_ADDFIELD_DLG_SC (RID_IMAGELIST_START + 6) +#define IMG_ADDFIELD_DLG_SCH (RID_IMAGELIST_START + 7) +#define IMG_ADDFIELD_DLG_LC (RID_IMAGELIST_START + 8) +#define IMG_ADDFIELD_DLG_LCH (RID_IMAGELIST_START + 9) // untyped #define RID_STR_BOOL (RID_UNTYPED_START + 0 ) diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index 22e29448b..14930fbab 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -171,9 +171,11 @@ OAddFieldWindow::OAddFieldWindow(Window* pParent ,m_xRowSet(_xRowSet) ,m_aActions(this,ModuleRes(RID_TB_SORTING)) ,m_pListBox(new OAddFieldWindowListBox( this )) + ,m_aInsertButton(this, WB_TABSTOP|WB_CENTER) ,m_nCommandType(0) ,m_bEscapeProcessing(sal_False) ,m_pChangeListener(NULL) + ,m_pContainerListener(NULL) { DBG_CTOR( rpt_OAddFieldWindow,NULL); SetHelpId( HID_RPT_FIELD_SEL_WIN ); @@ -181,7 +183,6 @@ OAddFieldWindow::OAddFieldWindow(Window* pParent SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING); - ,m_xRowSet(_xRowSet) m_aActions.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction)); @@ -290,7 +291,7 @@ void OAddFieldWindow::Update() m_pContainerListener = NULL; m_xColumns.clear(); - if ( m_xRowSet.is() ) + try { // ListBox loeschen m_pListBox->Clear(); @@ -348,7 +349,6 @@ void OAddFieldWindow::Update() } } OnSelectHdl(NULL); - } } } catch( const Exception& ) @@ -509,13 +509,5 @@ IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) // ----------------------------------------------------------------------------- // ============================================================================= } // namespace rptui -// ----------------------------------------------------------------------------- -IMPL_LINK( OAddFieldWindow, OnDoubleClickHdl, void* ,/*_pAddFieldDlg*/) -{ - if ( m_aCreateLink.IsSet() ) - m_aCreateLink.Call(this); - - return 0L; -} // ============================================================================= diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx index 928afc66b..abba6ad06 100644 --- a/reportdesign/source/ui/inc/AddField.hxx +++ b/reportdesign/source/ui/inc/AddField.hxx @@ -42,6 +42,7 @@ #include <svtools/transfer.hxx> #include <vcl/floatwin.hxx> #include <comphelper/propmultiplex.hxx> +#include <comphelper/containermultiplexer.hxx> #include <vcl/button.hxx> #include <svx/dataaccessdescriptor.hxx> @@ -68,7 +69,6 @@ class OAddFieldWindow :public FloatingWindow ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet; ToolBox m_aActions; - DECL_LINK( OnDoubleClickHdl, void* ); ::std::auto_ptr<OAddFieldWindowListBox> m_pListBox; @@ -128,8 +128,6 @@ public: */ void fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor); - inline void SetCreateHdl(const Link& _aCreateLink) { m_aCreateLink = _aCreateLink; } - private: // FmXChangeListener virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 597778223..c4b57b1a3 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -89,7 +89,8 @@ namespace rptui USHORT m_nCurrentPosition; USHORT m_eActObj; BOOL m_bFirstDraw; - Size m_aGridSize; + Size m_aGridSizeCoarse; + Size m_aGridSizeFine; BOOL m_bGridVisible; BOOL m_bGridSnap; BOOL m_bDeleted; @@ -188,7 +189,8 @@ namespace rptui ,const ::rtl::OUString& _sColorEntry ,USHORT _nPosition = USHRT_MAX); - inline Size getGridSize() const { return m_aGridSize; } + inline Size getGridSizeCoarse() const { return m_aGridSizeCoarse; } + inline Size getGridSizeFine() const { return m_aGridSizeFine; } inline BOOL isGridSnap() const { return m_bGridSnap; } void setGridSnap(BOOL bOn); void setDragStripes(BOOL bOn); @@ -273,7 +275,7 @@ namespace rptui /** zoom the ruler and view windows */ - void zoom(const sal_Int16 _nZoom); + void zoom(const Fraction& _aZoom); /** fills the vector with all selected control models /param _rSelection The vector will be filled and will not be cleared before. @@ -283,6 +285,11 @@ namespace rptui /** returns the selected field from the add field dialog */ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getSelectedFieldDescriptors(); + + /** calculates the zoom factor. + @param _eType which kind of zoom is needed + */ + sal_uInt16 getZoomFactor(SvxZoomType _eType) const; }; //================================================================== } //rptui diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 5cb7a2cfb..73945e7c5 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -53,6 +53,7 @@ #include <svtools/transfer.hxx> #include <svtools/lstner.hxx> #include <svx/svdedtv.hxx> +#include <svx/zoomitem.hxx> #include "ModuleHelper.hxx" #include <comphelper/uno3.hxx> @@ -118,8 +119,8 @@ namespace rptui sal_Int32 m_nSplitPos; /// the position of the splitter sal_Int32 m_nPageNum; /// the page number from the restoreView call sal_Int32 m_nSelectionCount; - //sal_Int32 m_nExecuteReportEvent; sal_Int16 m_nZoomValue; + SvxZoomType m_eZoomType; sal_Bool m_bShowRuler; sal_Bool m_bGridVisible; sal_Bool m_bGridUse; @@ -177,6 +178,10 @@ namespace rptui */ void openSortingAndGroupingDialog(); + /** opens the zoom dialog + */ + void openZoomDialog(); + /** returns the position of the group inside the groups collection */ sal_Int32 getGroupPosition(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup); @@ -294,7 +299,6 @@ namespace rptui DECL_LINK( OnClipboardChanged, void* ); DECL_LINK( OnExecuteReport, void* ); DECL_LINK( OnOpenHelpAgent, void* ); - short saveModified(); // all the features which should be handled by this class virtual void describeSupportedFeatures(); @@ -422,7 +426,8 @@ namespace rptui ::boost::shared_ptr<rptui::OReportModel> getSdrModel(); inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; } - inline sal_Int16 getZoomValue() const { return m_nZoomValue; } + inline sal_Int16 getZoomValue() const { return m_nZoomValue; } + inline void resetZoomType() { m_eZoomType = SVX_ZOOM_PERCENT; } // com::sun::star::beans::XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 8f379d975..3a666bb21 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -2032,7 +2032,7 @@ void GeometryHandler::impl_initFieldList_nothrow( uno::Sequence< ::rtl::OUString } catch (uno::Exception&) { - DBG_ERROR( "GeometryHandler::impl_initFieldList_nothrow: caught an exception!" ) + DBG_ERROR( "GeometryHandler::impl_initFieldList_nothrow: caught an exception!" ); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/inspection/inspection.src b/reportdesign/source/ui/inspection/inspection.src index dc2b4a09b..001086b6d 100644 --- a/reportdesign/source/ui/inspection/inspection.src +++ b/reportdesign/source/ui/inspection/inspection.src @@ -80,11 +80,6 @@ Resource RID_STR_FORCENEWPAGE_CONST Text [ en-US ] = "Before & After Section" ; }; }; -String RID_STR_NONE -{ - Text [ en-US ] = "None"; -}; - String RID_STR_NEWROWORCOL { Text [ en-US ] = "New Row Or Column" ; diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 047a129e5..48f19a52b 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -159,7 +159,8 @@ ODesignView::ODesignView( Window* pParent, ,m_nCurrentPosition(USHRT_MAX) ,m_eActObj( OBJ_NONE ) ,m_bFirstDraw(FALSE) - ,m_aGridSize( 250, 250 ) // 100TH_MM + ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid + ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation ,m_bGridVisible(TRUE) ,m_bGridSnap(TRUE) ,m_bDeleted( FALSE ) @@ -599,12 +600,12 @@ void ODesignView::toggleAddField() uno::Reference< report::XSection > xSection = m_pCurrentView->getReportSection()->getSection(); xReport = xSection->getReportDefinition(); } - uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY); - m_pAddField = new OAddFieldWindow(this,xSet); + uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
+ m_pAddField = new OAddFieldWindow(this,xSet);
m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) ); - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) ); - if ( aDlgOpt.Exists() ) - m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); + SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) );
+ if ( aDlgOpt.Exists() )
+ m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
m_pAddField->Update(); m_pAddField->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl)); notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::AddWindow)); @@ -764,19 +765,14 @@ sal_uInt32 ODesignView::getMarkedObjectCount() const return m_aScrollWindow.getMarkedObjectCount(); } // ----------------------------------------------------------------------------- -void ODesignView::zoom(const sal_Int16 _nZoom) +void ODesignView::zoom(const Fraction& _aZoom) { - m_aScrollWindow.zoom(_nZoom); + m_aScrollWindow.zoom(_aZoom); } // ----------------------------------------------------------------------------- -uno::Sequence< beans::PropertyValue > ODesignView::getSelectedFieldDescriptors() +sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const { - uno::Sequence< beans::PropertyValue > aArgs; - if ( isAddFieldVisible() ) - { - aArgs = m_pAddField->getSelectedFieldDescriptors(); - } - return aArgs; + return m_aScrollWindow.getZoomFactor(_eType); } //============================================================================ } // rptui diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 60e973d52..edc104110 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -60,7 +60,6 @@ #include <tools/diagnose_ex.h> #include "rptui_slotid.hrc" #include "reportformula.hxx" -#include "AddField.hxx" #include <comphelper/documentconstants.hxx> #include <comphelper/property.hxx> @@ -119,6 +118,9 @@ #include <svx/brshitem.hxx> #include <svx/flagsdef.hxx> //CHINA001 #include <svx/svdpagv.hxx> +#include <svx/svxdlg.hxx> +#include <svx/zoom_def.hxx> +#include <svx/dialogs.hrc> #include "DesignView.hxx" #include "ModuleHelper.hxx" @@ -284,7 +286,7 @@ DBG_NAME( rpt_OReportController ) OReportController::OReportController(Reference< XComponentContext > const & xContext) : OReportController_BASE(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)) ,OPropertyStateContainer(OGenericUnoController_Base::rBHelper) -,m_aSelectionListeners( m_aMutex ) +,m_aSelectionListeners( getMutex() ) ,m_pMyOwnView(NULL) ,m_pClipbordNotifier(NULL) ,m_pGroupsFloater(NULL) @@ -293,6 +295,7 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon ,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) @@ -304,7 +307,7 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon { m_sMode = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")); DBG_CTOR( rpt_OReportController,NULL); - registerProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomValue")),PROPERTY_ID_ZOOMVALUE,beans::PropertyAttribute::BOUND| beans::PropertyAttribute::TRANSIENT, &m_nZoomValue, ::getCppuType(reinterpret_cast< sal_Int16*>(NULL))); + registerProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomValue")),PROPERTY_ID_ZOOMVALUE,beans::PropertyAttribute::BOUND| beans::PropertyAttribute::TRANSIENT,&m_nZoomValue,::getCppuType(reinterpret_cast< sal_Int16*>(NULL))); } // ----------------------------------------------------------------------------- OReportController::~OReportController() @@ -899,8 +902,8 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_ATTR_ZOOM: aReturn.bEnabled = sal_True; { - SvxZoomItem aZoom(SVX_ZOOM_PERCENT,m_nZoomValue); - aZoom.SetValueSet(SVX_ZOOM_ENABLE_50|SVX_ZOOM_ENABLE_75|SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_150|SVX_ZOOM_ENABLE_200); + SvxZoomItem aZoom(m_eZoomType,m_nZoomValue); + aZoom.SetValueSet(SVX_ZOOM_ENABLE_50|SVX_ZOOM_ENABLE_75|SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_200); aZoom.QueryValue(aReturn.aValue); //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue); } @@ -908,11 +911,10 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_ATTR_ZOOMSLIDER: aReturn.bEnabled = sal_True; { - SvxZoomSliderItem aZoomSlider(m_nZoomValue); + SvxZoomSliderItem aZoomSlider(m_nZoomValue,20,400); aZoomSlider.AddSnappingPoint(50); aZoomSlider.AddSnappingPoint(75); aZoomSlider.AddSnappingPoint(100); - aZoomSlider.AddSnappingPoint(150); aZoomSlider.AddSnappingPoint(200); aZoomSlider.QueryValue(aReturn.aValue); //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue); @@ -952,7 +954,7 @@ namespace void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); if ( !getView() ) { switch(_nId) @@ -1599,11 +1601,16 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_GROUP: break; case SID_ATTR_ZOOM: - if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) + if ( aArgs.getLength() == 0 ) + { + openZoomDialog(); + } + else if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) { SvxZoomItem aZoomItem; aZoomItem.PutValue(aArgs[0].Value); m_nZoomValue = aZoomItem.GetValue(); + m_eZoomType = aZoomItem.GetType(); impl_zoom_nothrow(); } // if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) break; @@ -1613,6 +1620,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > SvxZoomSliderItem aZoomSlider; aZoomSlider.PutValue(aArgs[0].Value); m_nZoomValue = aZoomSlider.GetValue(); + m_eZoomType = SVX_ZOOM_PERCENT; impl_zoom_nothrow(); } break; @@ -1724,18 +1732,6 @@ IMPL_LINK( OReportController, OnOpenHelpAgent, void* ,/*_pMemfun*/) doOpenHelpAgent(); return 0L; } -// -----------------------------------------------------------------------------
-IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow* ,_pAddFieldDlg)
-{
- WaitObject aObj(m_pMyOwnView);
- uno::Sequence< beans::PropertyValue > aArgs = _pAddFieldDlg->getSelectedFieldDescriptors();
- // we use this way to create undo actions
- if ( aArgs.getLength() )
- {
- executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
- }
- return 0L;
-} // ----------------------------------------------------------------------------- IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow* ,_pAddFieldDlg) { @@ -1790,7 +1786,7 @@ sal_Bool SAL_CALL OReportController::suspend(sal_Bool /*_bSuspend*/) throw( Runt return sal_True; vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); if ( getView() && getView()->IsInModalMode() ) return sal_False; @@ -2064,7 +2060,7 @@ SfxUndoManager* OReportController::getUndoMgr() // ----------------------------------------------------------------------------- void OReportController::setModified(sal_Bool _bModified) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); try { if ( m_xReportDefinition.is() ) @@ -2110,7 +2106,7 @@ void OReportController::notifyGroupSections(const ContainerEvent& _rEvent,bool _ if ( xGroup.is() ) { ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); sal_Int32 nGroupPos = 0; _rEvent.Accessor >>= nGroupPos; @@ -2150,14 +2146,14 @@ void SAL_CALL OReportController::elementRemoved( const ContainerEvent& _rEvent ) void SAL_CALL OReportController::elementReplaced( const ContainerEvent& /*_rEvent*/ ) throw(RuntimeException) { ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); OSL_ENSURE(0,"Not yet implemented!"); } // ----------------------------------------------------------------------------- void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEvent& evt ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); try { sal_Bool bShow = sal_False; @@ -2415,6 +2411,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ uno::Any aValue; static_cast<const SvxSizeItem*>(pItem)->QueryValue(aValue,MID_SIZE_SIZE); xProp->setPropertyValue(PROPERTY_PAPERSIZE,aValue); + resetZoomType(); } if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_LRSPACE,sal_True,&pItem)) @@ -2435,6 +2432,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ uno::Any aValue; pPageItem->QueryValue(aValue,MID_PAGE_LAYOUT); xProp->setPropertyValue(PROPERTY_PAGESTYLELAYOUT,aValue); + resetZoomType(); } if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_BRUSH,sal_True,&pItem)) { @@ -2458,7 +2456,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OReportController::attachModel(const uno::Reference< frame::XModel > & xModel) throw( uno::RuntimeException ) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); m_xReportDefinition.set(xModel,uno::UNO_QUERY); return m_xReportDefinition.is(); } @@ -2532,7 +2530,7 @@ void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nCon // ----------------------------------------------------------------------------- uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException ) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); typedef ::std::pair< ::rtl::OUString,sal_uInt16> TStringIntPair; const TStringIntPair pViewDataList[] = { @@ -2602,7 +2600,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept // ----------------------------------------------------------------------------- void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException ) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); uno::Sequence<beans::PropertyValue> aProps; if ( Data >>= aProps ) { @@ -2863,7 +2861,7 @@ void OReportController::insertGraphic() // ----------------------------------------------------------------------------- ::sal_Bool SAL_CALL OReportController::select( const Any& aSelection ) throw (IllegalArgumentException, RuntimeException) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); ::sal_Bool bRet = sal_True; if ( m_pMyOwnView ) { @@ -2903,7 +2901,7 @@ void OReportController::insertGraphic() // ----------------------------------------------------------------------------- Any SAL_CALL OReportController::getSelection( ) throw (RuntimeException) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); Any aRet; if ( m_pMyOwnView ) { @@ -2980,8 +2978,9 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co } else { - SdrUnoObj* pLabel,*pControl; - FmFormView::createControlLabelPair(NULL,m_pMyOwnView + SdrUnoObj* pLabel( NULL ); + SdrUnoObj* pControl( NULL ); + FmFormView::createControlLabelPair(m_pMyOwnView ,nLeftMargin,0 ,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT, NULL,pSectionWindow->getReportSection().getPage(),m_aReportModel.get(), @@ -3120,11 +3119,11 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) pSectionWindow[0] = m_pMyOwnView->getMarkedSection(); if ( !pSectionWindow[0] ) - { - select(uno::makeAny(m_xReportDefinition->getDetail())); - pSectionWindow[0] = m_pMyOwnView->getMarkedSection(); - if ( !pSectionWindow[0] ) - return; + {
+ select(uno::makeAny(m_xReportDefinition->getDetail()));
+ pSectionWindow[0] = m_pMyOwnView->getMarkedSection();
+ if ( !pSectionWindow[0] )
+ return;
} uno::Reference<report::XSection> xCurrentSection = m_pMyOwnView->getCurrentSection(); @@ -3276,7 +3275,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) pSectionViews[0] = &pSectionWindow[1]->getReportSection().getSectionView(); pSectionViews[1] = &pSectionWindow[0]->getReportSection().getSectionView(); // find this in svx - FmFormView::createControlLabelPair(pSectionViews[0],m_pMyOwnView + FmFormView::createControlLabelPair(m_pMyOwnView ,nLeftMargin,0 ,xField,xNumberFormats,nOBJID,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT, pSectionWindow[1]->getReportSection().getPage(),pSectionWindow[0]->getReportSection().getPage(),m_aReportModel.get(), @@ -3794,7 +3793,7 @@ void OReportController::checkChartEnabled() throw (uno::RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); uno::Reference< frame::XTitle> xTitle(m_xReportDefinition,uno::UNO_QUERY_THROW); @@ -3832,12 +3831,12 @@ void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHa } void SAL_CALL OReportController::setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); m_sMode = aMode; } ::rtl::OUString SAL_CALL OReportController::getMode( ) throw (::com::sun::star::uno::RuntimeException) { - ::osl::MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard( getMutex() ); return m_sMode; } ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OReportController::getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException) @@ -3903,15 +3902,12 @@ void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty void OReportController::impl_zoom_nothrow() { Fraction aZoom(m_nZoomValue,100); - MapMode aMapMode = m_pMyOwnView->GetMapMode(); - aMapMode.SetScaleX(aZoom); - aMapMode.SetScaleY(aZoom); - m_pMyOwnView->SetMapMode(aMapMode); - m_pMyOwnView->zoom(m_nZoomValue); + setZoomFactor(aZoom,*m_pMyOwnView); + m_pMyOwnView->zoom(aZoom); // TRY /*m_pMyOwnView->Invalidate(INVALIDATE_NOCHILDREN);*/ - InvalidateFeature(SID_ATTR_ZOOM); - InvalidateFeature(SID_ATTR_ZOOMSLIDER); + InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(),sal_True); + InvalidateFeature(SID_ATTR_ZOOMSLIDER,Reference< XStatusListener >(),sal_True); } // ----------------------------------------------------------------------------- sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const uno::Reference< report::XReportControlFormat>& _xReportControlFormat) const @@ -3973,3 +3969,58 @@ void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomSh _rState.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE && m_pMyOwnView->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0; } // ----------------------------------------------------------------------------- +void OReportController::openZoomDialog() +{ + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + if ( pFact ) + { + static SfxItemInfo aItemInfos[] = + { + { SID_ATTR_ZOOM, SFX_ITEM_POOLABLE } + }; + SfxPoolItem* pDefaults[] = + { + new SvxZoomItem() + }; + static USHORT pRanges[] = + { + SID_ATTR_ZOOM,SID_ATTR_ZOOM, + 0 + }; + try + { + ::std::auto_ptr<SfxItemPool> pPool( new SfxItemPool(String::CreateFromAscii("ZoomProperties"), SID_ATTR_ZOOM,SID_ATTR_ZOOM, aItemInfos, pDefaults) ); + pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); // ripped, don't understand why + pPool->FreezeIdRanges(); // the same + + ::std::auto_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges)); + // fill it + SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOM ); + aZoomItem.SetValueSet(SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_WHOLEPAGE|SVX_ZOOM_ENABLE_PAGEWIDTH); + pDescriptor->Put(aZoomItem); + + ::std::auto_ptr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(NULL, *pDescriptor.get(), RID_SVXDLG_ZOOM) ); + pDlg->SetLimits( 20, 400 ); + bool bCancel = ( RET_CANCEL == pDlg->Execute() ); + + if ( !bCancel ) + { + const SvxZoomItem& rZoomItem = (const SvxZoomItem&)pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM ); + m_eZoomType = rZoomItem.GetType(); + m_nZoomValue = rZoomItem.GetValue(); + if ( m_eZoomType != SVX_ZOOM_PERCENT ) + m_nZoomValue = m_pMyOwnView->getZoomFactor( m_eZoomType ); + + impl_zoom_nothrow(); + } // if ( !bCancel ) + } + catch(uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } + + for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i) + delete pDefaults[i]; + } // if(pFact) +} +// ----------------------------------------------------------------------------- |