diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2018-01-23 16:49:14 +0300 |
---|---|---|
committer | Heiko Tietze <tietze.heiko@gmail.com> | 2018-01-26 10:31:13 +0100 |
commit | 1a8aac875ffb0a8c7b4161ff62807c1fb3e3e4a4 (patch) | |
tree | d97934b0ab5653da7dba38c41fcefdc23a6961e2 /sc/source/ui/view | |
parent | 90948976a557c49ec5e971b8ba6d8e62c58b6c7e (diff) |
[Pardus] tdf#87357 Add contextual Conditional Format command.
This patch is sponsored by ULAKBIM/Pardus project.
Change-Id: Id6148d39f68ac39067cc3a09b314c4f4de773384
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/48417
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index cae223dd5cde..0608924fcdde 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1221,6 +1221,24 @@ void ScCellShell::GetState(SfxItemSet &rSet) } break; + case SID_OPENDLG_CURRENTCONDFRMT: + case SID_OPENDLG_CURRENTCONDFRMT_MANAGER: + { + if ( pDoc ) + { + const SfxPoolItem* pItem = pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_CONDITIONAL ); + const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); + + if ( !pCondFormatItem->GetCondFormatData().size() ) + rSet.DisableItem( nWhich ); + else if ( pCondFormatItem->GetCondFormatData().size() == 1 ) + rSet.DisableItem( SID_OPENDLG_CURRENTCONDFRMT_MANAGER ); + else if ( pCondFormatItem->GetCondFormatData().size() > 1 ) + rSet.DisableItem( SID_OPENDLG_CURRENTCONDFRMT ); + } + } + break; + } // switch ( nWitch ) nWhich = aIter.NextWhich(); } // while ( nWitch ) diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 9a1e7dc8a3cf..eb1f270ce73a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -198,6 +198,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_SPELL_DIALOG: case SID_HANGUL_HANJA_CONVERSION: case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_CURRENTCONDFRMT: case SID_OPENDLG_COLORSCALE: case SID_OPENDLG_DATABAR: pScMod->InputEnterHandler(); @@ -1928,6 +1929,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) break; case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_CURRENTCONDFRMT: case SID_OPENDLG_COLORSCALE: case SID_OPENDLG_DATABAR: case SID_OPENDLG_ICONSET: @@ -2046,6 +2048,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) switch(nSlot) { case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_CURRENTCONDFRMT: eType = condformat::dialog::CONDITION; break; case SID_OPENDLG_COLORSCALE: @@ -2530,6 +2533,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) break; case SID_OPENDLG_CONDFRMT_MANAGER: + case SID_OPENDLG_CURRENTCONDFRMT_MANAGER: { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); assert(pFact); |