summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2018-01-23 16:49:14 +0300
committerHeiko Tietze <tietze.heiko@gmail.com>2018-01-26 10:31:13 +0100
commit1a8aac875ffb0a8c7b4161ff62807c1fb3e3e4a4 (patch)
treed97934b0ab5653da7dba38c41fcefdc23a6961e2 /sc
parent90948976a557c49ec5e971b8ba6d8e62c58b6c7e (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')
-rw-r--r--sc/inc/sc.hrc30
-rw-r--r--sc/sdi/cellsh.sdi54
-rw-r--r--sc/sdi/scalc.sdi35
-rw-r--r--sc/source/ui/view/cellsh.cxx18
-rw-r--r--sc/source/ui/view/cellsh1.cxx4
-rw-r--r--sc/uiconfig/scalc/popupmenu/cell.xml2
6 files changed, 103 insertions, 40 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 5c75ae6c8c45..e4823e58ff44 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -205,20 +205,22 @@
#define SID_AUTO_SUM (SC_MESSAGE_START + 39)
// messages for opening dialogs:
-#define SID_OPENDLG_CONSOLIDATE (SC_MESSAGE_START + 50)
-#define SID_OPENDLG_PIVOTTABLE (SC_MESSAGE_START + 51)
-#define SID_OPENDLG_FUNCTION (SC_MESSAGE_START + 52)
-#define SID_OPENDLG_SOLVE (SC_MESSAGE_START + 53)
-#define SID_OPENDLG_TABOP (SC_MESSAGE_START + 54)
-#define SID_OPENDLG_CONDFRMT (SC_MESSAGE_START + 59)
-#define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60)
-#define SID_VALIDITY_REFERENCE (SC_MESSAGE_START + 61)
-#define SID_OPENDLG_CONDFRMT_MANAGER (SC_MESSAGE_START + 62)
-#define SID_POPUP_CONDFRMT (SC_MESSAGE_START + 63)
-#define SID_OPENDLG_COLORSCALE (SC_MESSAGE_START + 66)
-#define SID_OPENDLG_DATABAR (SC_MESSAGE_START + 67)
-#define SID_OPENDLG_ICONSET (SC_MESSAGE_START + 68)
-#define SID_OPENDLG_CONDDATE (SC_MESSAGE_START + 69)
+#define SID_OPENDLG_CONSOLIDATE (SC_MESSAGE_START + 50)
+#define SID_OPENDLG_PIVOTTABLE (SC_MESSAGE_START + 51)
+#define SID_OPENDLG_FUNCTION (SC_MESSAGE_START + 52)
+#define SID_OPENDLG_SOLVE (SC_MESSAGE_START + 53)
+#define SID_OPENDLG_TABOP (SC_MESSAGE_START + 54)
+#define SID_OPENDLG_CURRENTCONDFRMT (SC_MESSAGE_START + 58)
+#define SID_OPENDLG_CONDFRMT (SC_MESSAGE_START + 59)
+#define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60)
+#define SID_VALIDITY_REFERENCE (SC_MESSAGE_START + 61)
+#define SID_OPENDLG_CONDFRMT_MANAGER (SC_MESSAGE_START + 62)
+#define SID_POPUP_CONDFRMT (SC_MESSAGE_START + 63)
+#define SID_OPENDLG_CURRENTCONDFRMT_MANAGER (SC_MESSAGE_START + 64)
+#define SID_OPENDLG_COLORSCALE (SC_MESSAGE_START + 66)
+#define SID_OPENDLG_DATABAR (SC_MESSAGE_START + 67)
+#define SID_OPENDLG_ICONSET (SC_MESSAGE_START + 68)
+#define SID_OPENDLG_CONDDATE (SC_MESSAGE_START + 69)
#define SID_RANDOM_NUMBER_GENERATOR_DIALOG (SC_MESSAGE_START + 70)
#define SID_SAMPLING_DIALOG (SC_MESSAGE_START + 71)
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 4fc0a44f1da0..f7610a9f854d 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -201,32 +201,34 @@ interface CellSelection
ToolBoxConfig, MenuConfig , AccelConfig;
]
- SID_TABOP [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_CONSOLIDATE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_INSERT_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_USE_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_CANCEL [ ExecMethod = Execute; ]
- SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_POPUP_CONDFRMT []
- SID_COLUMN_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
- SID_ROW_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
- SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_OPENDLG_COLORSCALE [ ExecMethod = ExecuteEdit; ]
- SID_OPENDLG_DATABAR [ ExecMethod = ExecuteEdit; ]
- SID_OPENDLG_ICONSET [ ExecMethod = ExecuteEdit; ]
- SID_OPENDLG_CONDDATE [ ExecMethod = ExecuteEdit; ]
- SID_OPENDLG_CONDFRMT_MANAGER [ ExecMethod = ExecuteEdit; ]
- FID_NOTE_VISIBLE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_HIDE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_SHOW_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_TOGGLE_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_HIDE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_SHOW_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- FID_DELETE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_INC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
- SID_SELECT_UNPROTECTED_CELLS [ ExecMethod = ExecuteEdit;]
+ SID_TABOP [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_CONSOLIDATE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_INSERT_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_USE_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_CANCEL [ ExecMethod = Execute; ]
+ SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_POPUP_CONDFRMT []
+ SID_COLUMN_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
+ SID_ROW_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
+ SID_OPENDLG_CURRENTCONDFRMT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_COLORSCALE [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_DATABAR [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_ICONSET [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_CONDDATE [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_CONDFRMT_MANAGER [ ExecMethod = ExecuteEdit; ]
+ SID_OPENDLG_CURRENTCONDFRMT_MANAGER [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_NOTE_VISIBLE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_HIDE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_SHOW_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_TOGGLE_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_HIDE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_SHOW_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_DELETE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_INC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ SID_SELECT_UNPROTECTED_CELLS [ ExecMethod = ExecuteEdit;]
SID_THESAURUS [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ]
SID_SPELL_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 0925e0483865..f238b4633721 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -701,6 +701,23 @@ SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT
GroupId = SfxGroupId::Format;
]
+SfxVoidItem CurrentConditionalFormatDialog SID_OPENDLG_CURRENTCONDFRMT
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
+
SfxVoidItem ColorScaleFormatDialog SID_OPENDLG_COLORSCALE
()
@@ -792,6 +809,24 @@ SfxVoidItem ConditionalFormatManagerDialog SID_OPENDLG_CONDFRMT_MANAGER
]
+SfxVoidItem CurrentConditionalFormatManagerDialog SID_OPENDLG_CURRENTCONDFRMT_MANAGER
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
+
+
SfxVoidItem ConsolidateExec SID_CONSOLIDATE
()
[
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);
diff --git a/sc/uiconfig/scalc/popupmenu/cell.xml b/sc/uiconfig/scalc/popupmenu/cell.xml
index 17e9a67994ab..07bb61e3e59b 100644
--- a/sc/uiconfig/scalc/popupmenu/cell.xml
+++ b/sc/uiconfig/scalc/popupmenu/cell.xml
@@ -25,6 +25,8 @@
<menu:menuitem menu:id=".uno:ResetAttributes"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:FormatCellDialog"/>
+ <menu:menuitem menu:id=".uno:CurrentConditionalFormatDialog"/>
+ <menu:menuitem menu:id=".uno:CurrentConditionalFormatManagerDialog"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:InsertCell"/>
<menu:menuitem menu:id=".uno:DeleteCell"/>