summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabvwshc.cxx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-01-29 23:47:00 -0400
committerCaolán McNamara <caolanm@redhat.com>2015-05-12 09:55:27 +0000
commit2b5915da481990fd6ea272104215d82b6fbf5dbb (patch)
treec42170e613b056cf0a157230b6ed2d4febf3d91c /sc/source/ui/view/tabvwshc.cxx
parent4f2c8194f485b1527fb4f4dfe23ce804937f1f9c (diff)
tdf#60573 Conditional formatting does not allow scrolling
If you need to apply conditional formatting to a cell not shown presently on your screen you cannot scroll to the position you would like to use. Change-Id: I18549316d2c725ce032a65cffb969bed21b771c3 Reviewed-on: https://gerrit.libreoffice.org/14258 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/view/tabvwshc.cxx')
-rw-r--r--sc/source/ui/view/tabvwshc.cxx56
1 files changed, 54 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 4d5d2d4a66d8..38502d2856a7 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -459,8 +459,60 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
}
break;
- default:
- OSL_FAIL( "ScTabViewShell::CreateRefDialog: unbekannte ID" );
+ case WID_CONDFRMT_REF:
+ {
+ sal_uInt32 nIndex = sal_uInt32(-1);
+ sal_uInt8 nType = 0;
+ bool bManaged = false;
+ bool bFound = false;
+
+ ScRangeList aRangeList;
+ ScConditionalFormat* pCondFormat;
+ condformat::dialog::ScCondFormatDialogType aDialogType;
+
+ // Get the pool item stored it by Conditional Format Manager Dialog.
+ const SfxPoolItem* pItem = NULL;
+ sal_uInt32 nItems(GetPool().GetItemCount2( SCITEM_STRING ));
+ for( sal_uInt32 nIter = 0; nIter < nItems; ++nIter )
+ {
+ if( NULL != (pItem = GetPool().GetItem2( SCITEM_STRING, nIter ) ) )
+ {
+ if ( ScCondFormatDlg::ParseXmlString(
+ static_cast<const SfxStringItem*>(pItem)->GetValue(),
+ nIndex, nType, bManaged))
+ {
+ bFound = true;
+ break;
+ }
+ }
+ }
+
+ ScViewData& rViewData = GetViewData();
+ rViewData.SetRefTabNo( rViewData.GetTabNo() );
+
+ aDialogType = static_cast< condformat::dialog::ScCondFormatDialogType > ( nType );
+ pCondFormat = pDoc->GetCondFormList(rViewData.GetTabNo())->GetFormat ( nIndex );
+
+ if ( pCondFormat )
+ aRangeList = pCondFormat->GetRange();
+ else
+ {
+ rViewData.GetMarkData().FillRangeListWithMarks(&aRangeList, false);
+ ScAddress aPos(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
+ if(aRangeList.empty())
+ {
+ ScRange* pRange = new ScRange(aPos);
+ aRangeList.push_back(pRange);
+ }
+ }
+
+ pResult = VclPtr<ScCondFormatDlg>::Create( pB, pCW, pParent, &rViewData, pCondFormat, aRangeList,
+ aRangeList.GetTopLeftCorner(), aDialogType, bManaged );
+
+ // Remove the pool item stored it by Conditional Format Manager Dialog.
+ if ( bFound && pItem )
+ GetPool().Remove( *pItem );
+ }
break;
}