Tag: cws_src680_swrefactor071015 User: ama Date: 2008-08-28 15:05:14+0000 Removed: dba/reportdesign/source/ui/inc/SectionsWindow.hxx dba/reportdesign/source/ui/report/SectionsWindow.cxx
Modified: dba/reportdesign/source/ui/report/ReportController.cxx dba/reportdesign/source/core/sdr/RptObject.cxx Log: RESYNC:; FILE REMOVED File Changes: Directory: /dba/reportdesign/source/ui/inc/ =========================================== File [removed]: SectionsWindow.hxx Directory: /dba/reportdesign/source/ui/report/ ============================================== File [removed]: SectionsWindow.cxx Directory: /dba/reportdesign/source/ui/report/ ============================================== File [changed]: ReportController.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.10.6.3&r2=1.10.6.4 Delta lines: +270 -104 ----------------------- --- ReportController.cxx 2008-06-25 13:09:43+0000 1.10.6.3 +++ ReportController.cxx 2008-08-28 15:04:51+0000 1.10.6.4 @@ -59,12 +59,12 @@ #include <tools/diagnose_ex.h> #include "rptui_slotid.hrc" #include "reportformula.hxx" + #include <comphelper/documentconstants.hxx> #include <comphelper/property.hxx> -#include <comphelper/types.hxx> -#include <svx/fmview.hxx> -#include <svx/paperinf.hxx> #include <comphelper/sequenceashashmap.hxx> +#include <comphelper/types.hxx> + #include <connectivity/dbtools.hxx> #include <com/sun/star/view/PaperFormat.hpp> #include <com/sun/star/style/GraphicLocation.hpp> @@ -93,52 +93,61 @@ #include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/frame/status/FontHeight.hpp> #include <com/sun/star/report/XFormattedField.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdbc/SQLWarning.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> -#include "DesignView.hxx" -#include "ModuleHelper.hxx" -#include "RptObject.hxx" -#include "Undo.hxx" -#include <svx/dataaccessdescriptor.hxx> #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> + +#include <svx/fmview.hxx> +#include <svx/paperinf.hxx> #include <svx/svxids.hrc> #include <svx/svdobj.hxx> +#include <svx/dataaccessdescriptor.hxx> +#include <svx/svxenum.hxx> +#include <svx/pageitem.hxx> +#include <svx/lrspitem.hxx> +#include <svx/ulspitem.hxx> +#include <svx/sizeitem.hxx> +#include <svx/zoomitem.hxx> +#include <svx/zoomslideritem.hxx> +#include <svx/brshitem.hxx> +#include <svx/flagsdef.hxx> //CHINA001 +#include <svx/svdpagv.hxx> + +#include "DesignView.hxx" +#include "ModuleHelper.hxx" +#include "RptObject.hxx" +#include "Undo.hxx" #include "uistrings.hrc" -#include <svtools/cliplistener.hxx> #include "RptDef.hxx" #include "ReportSection.hxx" #include "SectionView.hxx" #include "UndoActions.hxx" #include "dlgpage.hxx" -#ifndef _RPTUI_DLGRESID_HRC #include "RptResId.hrc" -#endif -#include <svx/svxenum.hxx> -#include <svx/pageitem.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/sizeitem.hxx> + #include <svtools/itempool.hxx> #include <svtools/itemset.hxx> +#include <svtools/aeitem.hxx> //CHINA001 +#include <svtools/cliplistener.hxx> + #include <vos/mutex.hxx> #include "PropertyForward.hxx" -#include <svtools/aeitem.hxx> //CHINA001 -#include <svx/brshitem.hxx> -#include <svx/flagsdef.hxx> //CHINA001 +#include "SectionWindow.hxx" + #include <toolkit/helper/convert.hxx> #include "GroupsSorting.hxx" #include "PageNumber.hxx" #include <toolkit/helper/vclunohelper.hxx> #include "UndoEnv.hxx" #include "InsertFunctions.hxx" -#include <svx/svdpagv.hxx> + #include <boost/mem_fn.hpp> #include <boost/bind.hpp> #include <boost/utility.hpp> -#include <com/sun/star/sdb/SQLContext.hpp> -#include <com/sun/star/sdbc/SQLWarning.hpp> - #include <cppuhelper/exc_hlp.hxx> #include <unotools/confignode.hxx> #include <helpids.hrc> @@ -161,6 +170,7 @@ using namespace ::rptui; using namespace ::dbaui; using namespace ::comphelper; +using namespace ::cppu; // ----------------------------------------------------------------------------- namespace @@ -262,17 +272,22 @@ { return *(new OReportController(xContext)); } + +#define PROPERTY_ID_ZOOMVALUE 1 + 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_pMyOwnView(NULL) ,m_pClipbordNotifier(NULL) ,m_pGroupsFloater(NULL) ,m_xContext(xContext) ,m_nSplitPos(-1) ,m_nPageNum(-1) -//,m_nExecuteReportEvent(0) +,m_nZoomValue(100) ,m_bShowRuler(sal_True) ,m_bGridVisible(sal_True) ,m_bGridUse(sal_True) @@ -282,7 +297,9 @@ ,m_bChartEnabled(false) ,m_bChartEnabledAsked(false) { + 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))); } // ----------------------------------------------------------------------------- OReportController::~OReportController() @@ -295,7 +312,6 @@ // ----------------------------------------------------------------------------- void OReportController::disposing() { - if ( getView() && m_pClipbordNotifier ) { m_pClipbordNotifier->ClearCallbackLink(); @@ -325,9 +341,9 @@ { try { - ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection(); - if ( pSection ) - pSection->deactivateOle(); + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection(); + if ( pSectionWindow ) + pSectionWindow->getReportSection().deactivateOle(); getUndoMgr()->Clear(); // clear all undo redo things listen(false); } @@ -335,7 +351,15 @@ { } } + + { + EventObject aDisposingEvent( *this ); + m_aSelectionListeners.disposeAndClear( aDisposingEvent ); + } + OReportController_BASE::disposing(); + + // disconnect(); try { @@ -498,6 +522,10 @@ case SID_TERMINATE_INPLACEACTIVATION: aReturn.bEnabled = sal_True; break; + case SID_SELECT_ALL_EDITS: + case SID_SELECT_ALL_LABELS: + aReturn.bEnabled = sal_True; + break; case SID_RPT_NEW_FUNCTION: aReturn.bEnabled = isEditable(); break; @@ -516,9 +544,9 @@ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId); if ( aReturn.bEnabled ) { - ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection(); - if ( pSection ) - aReturn.bEnabled = !pSection->isUiActive(); + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection(); + if ( pSectionWindow ) + aReturn.bEnabled = !pSectionWindow->getReportSection().isUiActive(); } { ::rtl::OUString sText = String(ModuleRes(RID_STR_DELETE)); @@ -729,9 +757,11 @@ aReturn.bEnabled = isConnected() && isEditable(); break; case SID_EDITDOC: - case SID_PAGEDIALOG: aReturn.bChecked = isEditable(); break; + case SID_PAGEDIALOG: + aReturn.bEnabled = isEditable(); + break; case SID_BACKGROUND_COLOR: impl_fillState_nothrow(PROPERTY_CONTROLBACKGROUND,aReturn); break; @@ -861,6 +891,28 @@ case SID_PRINTPREVIEW: aReturn.bEnabled = sal_False; break; + 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); + aZoom.QueryValue(aReturn.aValue); + //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue); + } + break; + case SID_ATTR_ZOOMSLIDER: + aReturn.bEnabled = sal_True; + { + SvxZoomSliderItem aZoomSlider(m_nZoomValue); + 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); + } + break; default: aReturn = OReportController_BASE::GetState(_nId); } @@ -1034,7 +1086,7 @@ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::BOTTOM,SID_SECTION_ALIGN_DOWN == _nId); break; case SID_SELECTALL: - m_pMyOwnView->SelectAll(); + m_pMyOwnView->SelectAll(OBJ_NONE); break; case SID_SELECTALL_IN_SECTION: { @@ -1047,11 +1099,17 @@ m_pMyOwnView->SetMode(RPTUI_SELECT); InvalidateFeature( SID_OBJECT_SELECT ); break; + case SID_SELECT_ALL_EDITS: + m_pMyOwnView->SelectAll(OBJ_DLG_FORMATTEDFIELD); + break; + case SID_SELECT_ALL_LABELS: + m_pMyOwnView->SelectAll(OBJ_DLG_FIXEDTEXT); + break; case SID_TERMINATE_INPLACEACTIVATION: { - ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection(); + ::boost::shared_ptr<OSectionWindow> pSection = m_pMyOwnView->getMarkedSection(); if ( pSection ) - pSection->deactivateOle(); + pSection->getReportSection().deactivateOle(); } break; case SID_SELECT: @@ -1310,9 +1368,11 @@ InvalidateAll(); break; case SID_RPT_SHOWREPORTEXPLORER: + if ( isUiVisible() ) m_pMyOwnView->toggleReportExplorer(); break; case SID_FM_ADD_FIELD: + if ( isUiVisible() ) m_pMyOwnView->toggleAddField(); break; case SID_SHOW_PROPERTYBROWSER: @@ -1321,11 +1381,14 @@ else m_pMyOwnView->setCurrentPage(m_sLastActivePage); + if ( isUiVisible() ) + { m_bShowProperties = !m_bShowProperties; if ( aArgs.getLength() == 1 ) aArgs[0].Value >>= m_bShowProperties; m_pMyOwnView->togglePropertyBrowser(m_bShowProperties); + } break; case SID_PROPERTYBROWSER_LAST_PAGE: // nothing to do m_sLastActivePage = m_pMyOwnView->getCurrentPage(); @@ -1529,18 +1592,24 @@ InvalidateAll(); return; case SID_GROUP: - // { - // ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection(); - //if ( pReportSection.get() ) - //{ - // ::std::vector< uno::Reference< uno::XInterface > > aSelection; - // uno::Reference<report::XSection> xSection = pReportSection->getSection(); - // const String sUndoAction(ModuleRes(RID_STR_UNDO_GROUP)); - // getUndoMgr()->EnterListAction( sUndoAction, String() ); - - // getUndoMgr()->LeaveListAction(); - // } - // } + break; + case SID_ATTR_ZOOM: + if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) + { + SvxZoomItem aZoomItem; + aZoomItem.PutValue(aArgs[0].Value); + m_nZoomValue = aZoomItem.GetValue(); + impl_zoom_nothrow(); + } // if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) + break; + case SID_ATTR_ZOOMSLIDER: + if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("ZoomSlider") ) + { + SvxZoomSliderItem aZoomSlider; + aZoomSlider.PutValue(aArgs[0].Value); + m_nZoomValue = aZoomSlider.GetValue(); + impl_zoom_nothrow(); + } break; default: OReportController_BASE::Execute(_nId,aArgs); @@ -1607,7 +1676,10 @@ m_nPageNum = -1; } m_pMyOwnView->collapseSections(m_aCollapsedSections); + impl_zoom_nothrow(); + m_pMyOwnView->Resize(); m_pMyOwnView->Invalidate(); + InvalidateAll(); if ( m_bShowProperties && m_nPageNum == -1 ) { @@ -1655,7 +1727,7 @@ // ----------------------------------------------------------------------------- sal_Bool OReportController::Construct(Window* pParent) { - m_pMyOwnView = new ODesignView(pParent,getORB(),this); + m_pMyOwnView = new ODesignView(pParent,getORB(),*this); StartListening(*(m_pMyOwnView)); m_pView = m_pMyOwnView; @@ -1713,6 +1785,8 @@ implDescribeSupportedFeature( ".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER, CommandGroup::VIEW ); + implDescribeSupportedFeature( ".uno:ZoomSlider", SID_ATTR_ZOOMSLIDER, CommandGroup::VIEW ); + implDescribeSupportedFeature( ".uno:Zoom", SID_ATTR_ZOOM, CommandGroup::VIEW ); //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING, CommandGroup::FORMAT ); @@ -1938,6 +2012,8 @@ implDescribeSupportedFeature( ".uno:NextMark", SID_NEXT_MARK); implDescribeSupportedFeature( ".uno:PrevMark", SID_PREV_MARK); implDescribeSupportedFeature( ".uno:TerminateInplaceActivation", SID_TERMINATE_INPLACEACTIVATION); + implDescribeSupportedFeature( ".uno:SelectAllLabels", SID_SELECT_ALL_LABELS); + implDescribeSupportedFeature( ".uno:SelectAllEdits", SID_SELECT_ALL_EDITS); } // ----------------------------------------------------------------------------- SfxUndoManager* OReportController::getUndoMgr() @@ -2086,7 +2162,7 @@ ) { InvalidateFeature(SID_FM_ADD_FIELD); - if ( !m_pMyOwnView->isAddFieldVisible() ) + if ( !m_pMyOwnView->isAddFieldVisible() && isUiVisible() ) m_pMyOwnView->toggleAddField(); } /// TODO: check what we need to notify here TitleHelper @@ -2355,7 +2431,7 @@ m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this); m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl)); } - else + else if ( isUiVisible() ) m_pGroupsFloater->Show(!m_pGroupsFloater->IsVisible()); } // ----------------------------------------------------------------------------- @@ -2462,15 +2538,19 @@ aProps[nCount].Value <<= aCollapsedSections; } - ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection(); - if ( pSection.get() ) + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection(); + if ( pSectionWindow.get() ) { const sal_Int32 nCount = aProps.getLength(); aProps.realloc( nCount + 1 ); aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection")); - aProps[nCount].Value <<= (sal_Int32)pSection->getPage()->GetPageNum(); - } - } + aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum(); + } // if ( pSectionWindow.get() ) + } // if ( m_pMyOwnView ) + const sal_Int32 nCount = aProps.getLength(); + aProps.realloc( nCount + 1 ); + aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor")); + aProps[nCount].Value <<= m_nZoomValue; return uno::makeAny(aProps); } // ----------------------------------------------------------------------------- @@ -2510,6 +2590,8 @@ pPropsIter->Value >>= m_aCollapsedSections; else if ( pPropsIter->Name.equalsAscii("MarkedSection") ) pPropsIter->Value >>= m_nPageNum; + else if ( pPropsIter->Name.equalsAscii("ZoomFactor") ) + pPropsIter->Value >>= m_nZoomValue; } } } @@ -2719,14 +2801,6 @@ } } // ----------------------------------------------------------------------------- -void OReportController::displayDesignFloater(sal_Bool _bShow) -{ - if ( m_pGroupsFloater ) - { - m_pGroupsFloater->Show( m_bGroupFloaterWasVisible && _bShow); - } -} -// ----------------------------------------------------------------------------- ::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel() { if ( !m_aReportModel ) @@ -2794,6 +2868,16 @@ return aRet; } // ----------------------------------------------------------------------------- +void SAL_CALL OReportController::addSelectionChangeListener( const Reference< view::XSelectionChangeListener >& _Listener ) throw (RuntimeException) +{ + m_aSelectionListeners.addInterface( _Listener ); +} +// ----------------------------------------------------------------------------- +void SAL_CALL OReportController::removeSelectionChangeListener( const Reference< view::XSelectionChangeListener >& _Listener ) throw (RuntimeException) +{ + m_aSelectionListeners.removeInterface( _Listener ); +} +// ----------------------------------------------------------------------------- void OReportController::createNewFunction(const uno::Any& _aValue) { uno::Reference< container::XIndexContainer> xFunctions(_aValue,uno::UNO_QUERY_THROW); @@ -2815,11 +2899,11 @@ { SequenceAsHashMap aMap(_aArgs); m_pMyOwnView->setMarked(_xSection ,sal_True); - ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection(); - if ( !pReportSection ) + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection(); + if ( !pSectionWindow ) return; - OSL_ENSURE(pReportSection->getSection() == _xSection,"Invalid section after marking the corrct one."); + OSL_ENSURE(pSectionWindow->getReportSection().getSection() == _xSection,"Invalid section after marking the corrct one."); sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN); const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN); @@ -2832,13 +2916,13 @@ uno::Reference< report::XReportComponent> xShapeProp; if ( _nObjectId == OBJ_CUSTOMSHAPE ) { - pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pReportSection->getPage(),m_aReportModel.get() ); + pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() ); xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY); - pReportSection->createDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond")),pNewControl); // TODO: use real custom shape type + pSectionWindow->getReportSection().createDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond")),pNewControl); // TODO: use real custom shape type } // if ( _nObjectId == OBJ_CUSTOMSHAPE ) else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId ) { - pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pReportSection->getPage(),m_aReportModel.get() ); + pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() ); pNewControl->SetLogicRect(Rectangle(3000,500,8000,5500)); // switch height and width xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW); @@ -2852,9 +2936,12 @@ { SdrUnoObj* pLabel( NULL ); SdrUnoObj* pControl( NULL ); - FmFormView::createControlLabelPair( m_pMyOwnView, nLeftMargin, 0, - NULL, NULL, _nObjectId, ::rtl::OUString(), ReportInventor, OBJ_DLG_FIXEDTEXT, - NULL, pReportSection->getPage(), m_aReportModel.get(), pLabel, pControl ); + FmFormView::createControlLabelPair(NULL,m_pMyOwnView + ,nLeftMargin,0 + ,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT, + NULL,pSectionWindow->getReportSection().getPage(),m_aReportModel.get(), + pLabel,pControl); + delete pLabel; pNewControl = pControl; @@ -2913,7 +3000,7 @@ aPos.X = nPaperWidth - nShapeWidth; xShapeProp->setPosition(aPos); - correctOverlapping(pNewControl,pReportSection); + correctOverlapping(pNewControl,pSectionWindow->getReportSection()); } // ----------------------------------------------------------------------------- void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs) @@ -2981,10 +3068,10 @@ m_pMyOwnView->unmarkAllObjects(NULL); ////////////////////////////////////////////////////////////////////// // Anhand des FormatKeys wird festgestellt, welches Feld benoetigt wird - ::boost::shared_ptr<OReportSection> pReportSection[2]; - pReportSection[0] = m_pMyOwnView->getMarkedSection(); + ::boost::shared_ptr<OSectionWindow> pSectionWindow[2]; + pSectionWindow[0] = m_pMyOwnView->getMarkedSection(); - if ( !pReportSection[0].get() ) + if ( !pSectionWindow[0] ) return; uno::Reference<report::XSection> xCurrentSection = m_pMyOwnView->getCurrentSection(); @@ -3009,7 +3096,7 @@ uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition(); m_pMyOwnView->setMarked(xSection,sal_True); - pReportSection[0] = m_pMyOwnView->getMarkedSection(); + pSectionWindow[0] = m_pMyOwnView->getMarkedSection(); sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN); awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION,awt::Point(nLeftMargin,0)); @@ -3018,17 +3105,17 @@ // LLA: new feature, add the Label in dependency of the given DND_ACTION one section up, normal or one section down sal_Int8 nDNDAction = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction")), sal_Int8(0)); - pReportSection[1] = pReportSection[0]; + pSectionWindow[1] = pSectionWindow[0]; // ::boost::shared_ptr<OReportSection> pReportSectionPost; sal_Bool bLabelAboveTextField = nDNDAction == DND_ACTION_COPY; if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINK ) { // Add the Label one Section up - pReportSection[1] = m_pMyOwnView->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST); - if (!pReportSection[1].get()) + pSectionWindow[1] = m_pMyOwnView->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST); + if (!pSectionWindow[1]) { // maybe out of bounds - pReportSection[1] = pReportSection[0]; + pSectionWindow[1] = pSectionWindow[0]; } } // clear all selections @@ -3133,13 +3220,14 @@ 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] = pReportSection[1]->getView(); - pSectionViews[1] = pReportSection[0]->getView(); + pSectionViews[0] = &pSectionWindow[1]->getReportSection().getSectionView(); + pSectionViews[1] = &pSectionWindow[0]->getReportSection().getSectionView(); // find this in svx - FmFormView::createControlLabelPair( m_pMyOwnView, nLeftMargin, 0, - xField, xNumberFormats, nOBJID, ::rtl::OUString(), ReportInventor, OBJ_DLG_FIXEDTEXT, - pReportSection[1]->getPage(), pReportSection[0]->getPage(), m_aReportModel.get(), - pControl[0], pControl[1] ); + FmFormView::createControlLabelPair(pSectionViews[0],m_pMyOwnView + ,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(); if ( pControl[0] && pControl[1] ) { @@ -3210,7 +3298,7 @@ if (bLabelAboveTextField) { // move the label down near the splitter - const uno::Reference<report::XSection> xLabelSection = pReportSection[1]->getSection(); + const uno::Reference<report::XSection> xLabelSection = pSectionWindow[1]->getReportSection().getSection(); aPosLabel.Y = xLabelSection->getHeight() - xShapePropLabel->getHeight(); } else @@ -3226,7 +3314,7 @@ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i) // insert controls { - correctOverlapping(pControl[i],pReportSection[1-i]); + correctOverlapping(pControl[i],pSectionWindow[1-i]->getReportSection()); } if (!bLabelAboveTextField ) @@ -3245,7 +3333,7 @@ bool bHasToMove = false; while ( bOverlapping ) { - const SdrObject* pOverlappedObj = isOver(aLabelAndTextfield, *pReportSection[0]->getPage(), *pSectionViews[0], true, pControl, 2); + const SdrObject* pOverlappedObj = isOver(aLabelAndTextfield, *pSectionWindow[0]->getReportSection().getPage(), *pSectionViews[0], true, pControl, 2); bOverlapping = pOverlappedObj != NULL; if ( bOverlapping ) { @@ -3293,9 +3381,9 @@ OSectionView* OReportController::getCurrentSectionView() const { OSectionView* pSectionView = NULL; - ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection(); - if ( pReportSection.get() ) - pSectionView = pReportSection->getView(); + ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_pMyOwnView->getMarkedSection(); + if ( pSectionWindow.get() ) + pSectionView = &pSectionWindow->getReportSection().getSectionView(); return pSectionView; } // ----------------------------------------------------------------------------- @@ -3578,12 +3666,12 @@ // ----------------------------------------------------------------------------- void OReportController::markSection(const bool _bNext) { - ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection(); + ::boost::shared_ptr<OSectionWindow> pSection = m_pMyOwnView->getMarkedSection(); if ( pSection ) { - ::boost::shared_ptr<OReportSection> pPrevSection = m_pMyOwnView->getMarkedSection(_bNext ? POST : PREVIOUS); + ::boost::shared_ptr<OSectionWindow> pPrevSection = m_pMyOwnView->getMarkedSection(_bNext ? POST : PREVIOUS); if ( pPrevSection != pSection && pPrevSection ) - select(uno::makeAny(pPrevSection->getSection())); + select(uno::makeAny(pPrevSection->getReportSection().getSection())); else select(uno::makeAny(m_xReportDefinition)); } @@ -3592,7 +3680,7 @@ m_pMyOwnView->markSection(_bNext ? 0 : m_pMyOwnView->getSectionCount() - 1); pSection = m_pMyOwnView->getMarkedSection(); if ( pSection ) - select(uno::makeAny(pSection->getSection())); + select(uno::makeAny(pSection->getReportSection().getSection())); } } // ----------------------------------------------------------------------------- @@ -3643,6 +3731,7 @@ } } } +// ----------------------------------------------------------------------------- // css.frame.XTitle ::rtl::OUString SAL_CALL OReportController::getTitle() @@ -3656,6 +3745,69 @@ return xTitle->getTitle (); } // ----------------------------------------------------------------------------- +void OReportController::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const +{ + _rDefault <<= sal_Int16(100); +} +// ----------------------------------------------------------------------------- +// comphelper::OPropertyArrayUsageHelper +::cppu::IPropertyArrayHelper* OReportController::createArrayHelper( ) const +{ + Sequence< Property > aProps; + describeProperties(aProps); + return new ::cppu::OPropertyArrayHelper(aProps); +} +// ------------------------------------------------------------------------- + +// cppu::OPropertySetHelper +::cppu::IPropertyArrayHelper& SAL_CALL OReportController::getInfoHelper() +{ + typedef ::comphelper::OPropertyArrayUsageHelper<OReportController_BASE> OReportController_PROP; + return *OReportController_PROP::getArrayHelper(); +} +// ----------------------------------------------------------------------------- +void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,const Any& _aValue) throw (Exception) +{ + if ( _nHandle == PROPERTY_ID_ZOOMVALUE ) + { + _aValue >>= m_nZoomValue; + impl_zoom_nothrow(); + } +} +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); + m_sMode = aMode; +} +::rtl::OUString SAL_CALL OReportController::getMode( ) throw (::com::sun::star::uno::RuntimeException) +{ + ::osl::MutexGuard aGuard(m_aMutex); + return m_sMode; +} +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OReportController::getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException) +{ + static ::rtl::OUString s_sModes[] = { ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("remote")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")) }; + return uno::Sequence< ::rtl::OUString> (&s_sModes[0],sizeof(s_sModes)/sizeof(s_sModes[0])); +} +::sal_Bool SAL_CALL OReportController::supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString> aModes = getSupportedModes(); + const ::rtl::OUString* pIter = aModes.getConstArray(); + const ::rtl::OUString* pEnd = pIter + aModes.getLength(); + for(;pIter != pEnd;++pIter) + { + if ( pIter->equals(aMode ) ) + break; + } + return pIter != pEnd; +} +// ----------------------------------------------------------------------------- +bool OReportController::isUiVisible() const +{ + return !m_sMode.equalsAscii("remote"); +} +// ----------------------------------------------------------------------------- void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty,dbaui::FeatureState& _rState) const { _rState.bEnabled = isEditable(); @@ -3692,6 +3844,20 @@ } // if ( _rState.bEnabled ) } // ----------------------------------------------------------------------------- +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); + // TRY + /*m_pMyOwnView->Invalidate(INVALIDATE_NOCHILDREN);*/ + InvalidateFeature(SID_ATTR_ZOOM); + InvalidateFeature(SID_ATTR_ZOOMSLIDER); +} +// ----------------------------------------------------------------------------- sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const uno::Reference< report::XReportControlFormat>& _xReportControlFormat) const { sal_Bool bRet = sal_False; Directory: /dba/reportdesign/source/core/sdr/ ============================================= File [changed]: RptObject.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/RptObject.cxx?r1=1.6.6.4&r2=1.6.6.5 Delta lines: +12 -12 --------------------- --- RptObject.cxx 2008-06-26 07:32:37+0000 1.6.6.4 +++ RptObject.cxx 2008-08-28 15:04:54+0000 1.6.6.5 @@ -122,9 +122,16 @@ switch( nType ) { case OBJ_DLG_FIXEDTEXT: - pNewObj = new OUnoObject( _xComponent + { + OUnoObject* pUnoObj = new OUnoObject( _xComponent ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")) ,OBJ_DLG_FIXEDTEXT); + pNewObj = pUnoObj; + + uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY); + if ( xControlModel.is() ) + xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(sal_True)); + } break; case OBJ_DLG_IMAGECONTROL: pNewObj = new OUnoObject(_xComponent @@ -488,7 +495,6 @@ SetPropsFromRect(rRect); } //---------------------------------------------------------------------------- - FASTBOOL OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { FASTBOOL bResult = SdrObjCustomShape::EndCreate(rStat, eCmd); @@ -677,8 +683,10 @@ try { if ( supportsService( SERVICE_FIXEDTEXT ) ) + { m_xReportComponent->setPropertyValue( PROPERTY_LABEL, uno::makeAny(GetDefaultName(this)) ); } + } catch(const uno::Exception&) { OSL_ENSURE(0,"OUnoObject::EndCreate: Exception caught!"); @@ -851,14 +859,6 @@ DBG_CTOR( rpt_OOle2Obj, NULL); m_bIsListening = sal_True; } -// ----------------------------------------------------------------------------- -OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,const svt::EmbeddedObjectRef& rNewObjRef, const String& rNewObjName, const Rectangle& rNewRect,UINT16 _nType, FASTBOOL bFrame_) - :SdrOle2Obj(rNewObjRef,rNewObjName,rNewRect,bFrame_) - ,OObjectBase(_sComponentName) - ,m_nType(_nType) -{ - m_bIsListening = sal_True; -} //---------------------------------------------------------------------------- OOle2Obj::~OOle2Obj() { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
