diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/pvfundlg.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pvlaydlg.cxx | 57 | ||||
-rw-r--r-- | sc/source/ui/inc/pvlaydlg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 8 |
8 files changed, 66 insertions, 23 deletions
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 6b04993ba0bc..b5a19ef0ec9b 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -735,8 +735,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR for (long nDim=0; nDim<nDimCount; nDim++) { BOOL bIsDataLayout; - String aName = rDPObj.GetDimName( nDim, bIsDataLayout ); - if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) ) + sal_Int32 nDimFlags = 0; + String aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags ); + if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) ) { const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0; if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 1eca44a787ed..56d7e3550cda 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -567,7 +567,9 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po } } - if ( (toArr->back().get() == NULL) + bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType ); + if ( bAllowed + && (toArr->back().get() == NULL) && (!Contains( toArr, fData.mnCol, nAt )) ) { // ggF. in anderem Fenster entfernen @@ -714,7 +716,8 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF { ScDPFuncData fData( *((*fromArr)[nFromIndex]) ); - if ( Contains( fromArr, fData.mnCol, nAt ) ) + bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType ); + if ( bAllowed && Contains( fromArr, fData.mnCol, nAt ) ) { fromWnd->DelField( nAt ); Remove( fromArr, nAt ); @@ -935,21 +938,41 @@ PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt ) if ( bIsDrag ) { Point aPos = ScreenToOutputPixel( rAt ); + ScDPFieldType eCheckTarget = TYPE_SELECT; if ( aRectPage.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_PAGE ); + eCheckTarget = TYPE_PAGE; else if ( aRectCol.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_COL ); + eCheckTarget = TYPE_COL; else if ( aRectRow.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_ROW ); + eCheckTarget = TYPE_ROW; else if ( aRectData.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_DATA ); + eCheckTarget = TYPE_DATA; else if ( eDnDFromType != TYPE_SELECT ) ePtr = POINTER_PIVOT_DELETE; else if ( aRectSelect.IsInside( aPos ) ) ePtr = lclGetPointerForField( TYPE_SELECT ); else ePtr = POINTER_NOTALLOWED; + + if ( eCheckTarget != TYPE_SELECT ) + { + // check if the target orientation is allowed for this field + ScDPFuncDataVec* fromArr = NULL; + switch ( eDnDFromType ) + { + case TYPE_PAGE: fromArr = &aPageArr; break; + case TYPE_COL: fromArr = &aColArr; break; + case TYPE_ROW: fromArr = &aRowArr; break; + case TYPE_DATA: fromArr = &aDataArr; break; + case TYPE_SELECT: fromArr = &aSelectArr; break; + } + ScDPFuncData fData( *((*fromArr)[nDnDFromIndex]) ); + if (IsOrientationAllowed( fData.mnCol, eCheckTarget )) + ePtr = lclGetPointerForField( eCheckTarget ); + else + ePtr = POINTER_NOTALLOWED; + } } return ePtr; @@ -1218,6 +1241,28 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) return String(); } +//---------------------------------------------------------------------------- + +bool ScDPLayoutDlg::IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ) +{ + bool bAllowed = true; + ScDPLabelData* pData = GetLabelData( nCol ); + DBG_ASSERT( pData, "LabelData not found" ); + if (pData) + { + sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN; + switch (eType) + { + case TYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break; + case TYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break; + case TYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break; + case TYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break; + case TYPE_SELECT: eOrient = sheet::DataPilotFieldOrientation_HIDDEN; break; + } + bAllowed = ScDPObject::IsOrientationAllowed( (USHORT)eOrient, pData->mnFlags ); + } + return bAllowed; +} //---------------------------------------------------------------------------- diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index c74b9e028d2f..e16c3266510e 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -198,6 +198,7 @@ private: Point DlgPos2WndPos ( const Point& rPt, Window& rWnd ); ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL ); String GetLabelString ( SCsCOL nCol ); + bool IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ); String GetFuncString ( USHORT& rFuncMask, BOOL bIsValue = TRUE ); BOOL Contains ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt ); void Remove ( ScDPFuncDataVec* pArr, size_t nAt ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index b4313c1d7a32..28cc2a823928 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -144,7 +144,6 @@ private: ScNavigatorSettings* pNavSettings; // used in first Activate - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aPendingUserData; BOOL bFirstActivate; BOOL bActiveDrawSh; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index a64814d952ef..ec584213898c 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -309,10 +309,17 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) aPosRect, nOrient, nDimPos ); UpdateDragRect( bHasRange && bMove, aPosRect ); + BOOL bIsDataLayout; + sal_Int32 nDimFlags = 0; + String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout, &nDimFlags ); + bool bAllowed = !bHasRange || ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ); + if (bMove) // set mouse pointer { PointerStyle ePointer = POINTER_PIVOT_DELETE; - if ( bHasRange ) + if ( !bAllowed ) + ePointer = POINTER_NOTALLOWED; + else if ( bHasRange ) switch (nOrient) { case sheet::DataPilotFieldOrientation_COLUMN: ePointer = POINTER_PIVOT_COL; break; @@ -327,15 +334,13 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) if (!bHasRange) nOrient = sheet::DataPilotFieldOrientation_HIDDEN; - BOOL bIsDataLayout; - String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout ); if ( bIsDataLayout && ( nOrient != sheet::DataPilotFieldOrientation_COLUMN && nOrient != sheet::DataPilotFieldOrientation_ROW ) ) { // removing data layout is not allowed pViewData->GetView()->ErrorMessage(STR_PIVOT_MOVENOTALLOWED); } - else + else if ( bAllowed ) { ScDPSaveData aSaveData( *pDragDPObj->GetSaveData() ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 38d5144274c5..48ffd4fd39a4 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -108,7 +108,7 @@ SFX_IMPL_INTERFACE( ScPreviewShell, SfxViewShell, ScResId(SCSTR_PREVIEWSHELL) ) SFX_POPUPMENU_REGISTRATION(ScResId(RID_POPUP_PREVIEW)); } -SFX_IMPL_VIEWFACTORY( ScPreviewShell, ScResId(STR_NONAME) ) +SFX_IMPL_NAMED_VIEWFACTORY( ScPreviewShell, "PrintPreview" ) { SFX_VIEW_REGISTRATION(ScDocShell); } diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 1733cf2e19b5..2fc2bba072d9 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -102,7 +102,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) //-->Added by PengYunQuan for Validity Cell Range Picker } -SFX_IMPL_VIEWFACTORY( ScTabViewShell, ScResId(STR_NONAME) ) +SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" ) { SFX_VIEW_REGISTRATION(ScDocShell); } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index ed09ec85ee8c..0835d08de9fd 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -173,13 +173,6 @@ void __EXPORT ScTabViewShell::Activate(BOOL bMDI) SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) ); bFirstActivate = FALSE; - if ( aPendingUserData.hasElements() ) - { - // #89897# read user data from print preview now, after ctor - DoReadUserDataSequence( aPendingUserData ); - aPendingUserData.realloc( 0 ); - } - // #116278# ReadExtOptions (view settings from Excel import) must also be done // after the ctor, because of the potential calls to Window::Show. // Even after the fix for #104887# (Window::Show no longer notifies the access @@ -1924,7 +1917,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, if ( pOldSh && pOldSh->ISA( ScPreviewShell ) ) { ScPreviewShell* pPreviewShell = ((ScPreviewShell*)pOldSh); - aPendingUserData = pPreviewShell->GetSourceData(); // used in Activate nForceDesignMode = pPreviewShell->GetSourceDesignMode(); } |