bin/find-unused-sid-commands.py | 53 +++++ sc/inc/sc.hrc | 23 -- sc/sdi/cellsh.sdi | 9 - sc/sdi/docsh.sdi | 4 sc/sdi/scalc.sdi | 349 --------------------------------------- sc/sdi/tabvwsh.sdi | 8 sc/source/ui/docshell/docsh4.cxx | 49 ----- sc/source/ui/view/cellsh.cxx | 52 ----- sc/source/ui/view/cellsh1.cxx | 12 - sc/source/ui/view/cellsh3.cxx | 18 -- sc/source/ui/view/tabvwsh3.cxx | 7 sc/source/ui/view/tabvwshh.cxx | 161 ----------------- 12 files changed, 55 insertions(+), 690 deletions(-)
New commits: commit 9c4350441191ccfd6af3d73e13b4eb59af7ed6d1 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Thu Dec 21 09:21:42 2017 +0200 unused SID commands in sc Change-Id: Ifb732e0a52ac7222e0dfb7054981708fa5722b35 Reviewed-on: https://gerrit.libreoffice.org/46886 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/bin/find-unused-sid-commands.py b/bin/find-unused-sid-commands.py new file mode 100755 index 000000000000..32f45e0f810a --- /dev/null +++ b/bin/find-unused-sid-commands.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +# +# Find potentially unused UNO command entries in SDI files. +# +# Note that this is not foolproof, some extra checking is required because some command names might be +# constructed at runtime. +# + +import subprocess + +# search for entries in .sdi files that declare UNO/SID commands +a = subprocess.Popen("git grep -P '^\s*\w+Item\s+\w+\s+SID_\w+$' -- *.sdi", stdout=subprocess.PIPE, shell=True) + +# parse out the UNO command names +commandSet = list() +with a.stdout as txt: + for line in txt: + line = line.strip() + idx1 = line.find(" ") + idx2 = line.find(" ", idx1 + 1) + commandName = line[idx1+1 : idx2].strip() + sidName = line[idx2+1:].strip() + commandSet.append((commandName,sidName)) + +# now check to see if that UNO command is called anywhere in the codebase. +for pair in commandSet: + commandName = pair[0] + sidName = pair[1] + + # check to see if that UNO command is called anywhere in the codebase. + a = subprocess.Popen("git grep -wFn '.uno:" + commandName + "'", stdout=subprocess.PIPE, shell=True) + cnt = 0 + with a.stdout as txt2: + for line2 in txt2: + cnt = cnt + 1 + if cnt > 0: continue + + # check to see if the SID is used programmatically + foundLines = "" + a = subprocess.Popen("git grep -wn " + sidName, stdout=subprocess.PIPE, shell=True) + with a.stdout as txt2: + for line2 in txt2: + foundLines = foundLines + line2 + if foundLines.find("ExecuteList") != -1: continue + if foundLines.find("GetDispatcher()->Execute") != -1: continue + if foundLines.find("ExecuteScenarioSlot") != -1: continue + # TODO not sure about this, but let's tackle the easy ones first + if foundLines.find("Invalidate(") != -1: continue + + # dump any lines that contain the SID, so we can eyeball the results + print("remove: " + commandName) + print(foundLines) + print("----------------------------------------------------------------------------") diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index ee3caa1d7e7c..91f29cbaadd4 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -194,8 +194,6 @@ #define SID_CHART_NAME (SC_MESSAGE_START + 26) #define SID_CHART_ADDSOURCE (SC_MESSAGE_START + 27) -#define SID_AUTO_STYLE (SC_MESSAGE_START + 28) - #define FID_INPUTLINE_BLOCK (SC_MESSAGE_START + 29) #define SID_STATUS_SUM (SC_MESSAGE_START + 30) @@ -438,7 +436,6 @@ #define DETECTIVE_END (DETECTIVE_START+20) #define SID_API_SLOTS (DETECTIVE_END) -#define SID_INSERT_MATRIX (SID_API_SLOTS+1) #define SID_DELETE_NOTE (SID_API_SLOTS+2) @@ -494,8 +491,6 @@ #define SID_SETINPUTMODE (SID_KEYFUNC_START + 31) #define SID_DELETE_CONTENTS (SID_KEYFUNC_START + 32) -#define SID_MARKAREA (SID_KEYFUNC_START + 33) - #define FID_FILL_AUTO (SID_KEYFUNC_START + 35) #define SID_CANCEL (SID_KEYFUNC_START + 36) @@ -518,20 +513,12 @@ #define SID_RANGE_ROW (SID_NEW_SLOTS+20) #define SID_RANGE_COL (SID_NEW_SLOTS+21) -#define SID_RANGE_TABLE (SID_NEW_SLOTS+22) -#define SID_RANGE_VALUE (SID_NEW_SLOTS+23) -#define SID_RANGE_FORMULA (SID_NEW_SLOTS+24) -#define SID_RANGE_TEXTVALUE (SID_NEW_SLOTS+26) -#define SID_TABLE_ACTIVATE (SID_NEW_SLOTS+27) #define SID_DEFINE_PRINTAREA (SID_NEW_SLOTS+31) #define SID_DELETE_PRINTAREA (SID_NEW_SLOTS+32) #define SID_CHANGE_PRINTAREA (SID_NEW_SLOTS+33) #define SID_OPENDLG_EDIT_PRINTAREA (SID_NEW_SLOTS+34) -#define SID_OLE_ACTIVATE (SID_NEW_SLOTS+36) -#define SID_OLE_DEACTIVATE (SID_NEW_SLOTS+37) - #define SID_TOGGLE_REL (SID_NEW_SLOTS+38) #define SID_DATA_SELECT (SID_NEW_SLOTS+39) @@ -543,13 +530,8 @@ #define FID_REPLACE_ALL (SID_NEW_SLOTS+44) #define FID_SEARCH_COUNT (SID_NEW_SLOTS+45) -#define SID_SC_SETTEXT (SID_NEW_SLOTS+46) -#define SID_RANGE_ADDRESS (SID_NEW_SLOTS+47) #define SID_NUMBER_FORMAT (SID_NEW_SLOTS+49) -#define SID_OLE_SELECT (SID_NEW_SLOTS+50) - -#define SID_RANGE_NOTETEXT (SID_NEW_SLOTS+52) #define FID_INSERT_FILE (SID_NEW_SLOTS+53) #define FID_VALIDATION (SID_NEW_SLOTS+54) @@ -592,11 +574,6 @@ #define FID_RESET_PRINTZOOM (SID_NEW_SLOTS+82) #define SID_TABLES_COUNT (SID_NEW_SLOTS+83) -#define SID_ACTIVE_OBJ_NAME (SID_NEW_SLOTS+84) -#define SID_OBJECT_LEFT (SID_NEW_SLOTS+85) -#define SID_OBJECT_TOP (SID_NEW_SLOTS+86) -#define SID_OBJECT_WIDTH (SID_NEW_SLOTS+87) -#define SID_OBJECT_HEIGHT (SID_NEW_SLOTS+88) #define SID_DELETE_SCENARIO (SID_NEW_SLOTS+95) #define SID_EDIT_SCENARIO (SID_NEW_SLOTS+96) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index decb76cfc659..ece262c3e276 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -65,23 +65,14 @@ interface CellSelection // } database operations - SID_RANGE_ADDRESS [ StateMethod = GetState; ] - SID_HYPERLINK_SETLINK [ ExecMethod = ExecuteEdit; ] SID_HYPERLINK_GETLINK [ StateMethod = GetHLinkState; ] SID_UPDATECHART [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_RANGE_ROW [ StateMethod = GetState; ] SID_RANGE_COL [ StateMethod = GetState; ] - SID_RANGE_TABLE [ StateMethod = GetState; ] - SID_RANGE_VALUE [ StateMethod = GetState; ] - SID_RANGE_FORMULA [ StateMethod = GetState; ] - SID_RANGE_TEXTVALUE [ StateMethod = GetState; ] - SID_RANGE_NOTETEXT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_ENTER_STRING [ ExecMethod = Execute; StateMethod = GetState; ] - SID_INSERT_MATRIX [ ExecMethod = Execute; StateMethod = GetState; ] - SID_MARKAREA [ ExecMethod = Execute; ] SID_SELECT_SCENARIO [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] FID_CELL_FORMAT [ ExecMethod = Execute; StateMethod = GetBlockState; ] SID_ENABLE_HYPHENATION [ ExecMethod = Execute; StateMethod = GetBlockState; ] diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi index fdb22acf3e0c..612d09e54006 100644 --- a/sc/sdi/docsh.sdi +++ b/sc/sdi/docsh.sdi @@ -40,8 +40,6 @@ interface TableSelection FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] - - SID_TABLE_ACTIVATE [ ExecMethod = Execute; ] } @@ -50,7 +48,6 @@ interface TableDocument { SID_OPEN_CALC [ ExecMethod = Execute; StateMethod = GetState; ] SID_SBA_IMPORT [ ExecMethod = Execute; StateMethod = GetState; ] - SID_SC_SETTEXT [ ExecMethod = Execute; StateMethod = GetState; ] SID_TABLES_COUNT [ StateMethod = GetState; ] SID_ATTR_YEAR2000 [ StateMethod = GetState; ExecMethod = Execute; ] SID_CHART_SOURCE [ ExecMethod = Execute; ] @@ -60,7 +57,6 @@ interface TableDocument FID_HARD_RECALC [ ExecMethod = Execute; StateMethod = GetState; ] SID_UPDATETABLINKS [ ExecMethod = Execute; ] SID_REIMPORT_AFTER_LOAD [ ExecMethod = Execute; ] - SID_AUTO_STYLE [ ExecMethod = Execute; ] SID_GET_COLORLIST [ ExecMethod = Execute; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index e06f17bd4695..fb047eef718e 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -34,42 +34,6 @@ SfxVoidItem AcceptChanges FID_CHG_ACCEPT ] -SfxVoidItem ActivateOLE SID_OLE_ACTIVATE -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Special; -] - - -SfxVoidItem ActivateTable SID_TABLE_ACTIVATE -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::View; -] - - SfxVoidItem Add FID_TAB_APPEND (SfxStringItem Name FID_TAB_APPEND) [ @@ -122,22 +86,6 @@ SfxVoidItem AddPrintArea SID_ADD_PRINTAREA ] -SfxStringItem Address SID_RANGE_ADDRESS -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = ; -] - - SfxVoidItem AdjustPrintZoom FID_ADJUST_PRINTZOOM () [ @@ -411,24 +359,6 @@ SfxBoolItem AutoRefreshArrows SID_DETECTIVE_AUTO ] -SfxVoidItem AutoStyle SID_AUTO_STYLE -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem Calculate FID_RECALC () [ @@ -1112,24 +1042,6 @@ SfxVoidItem DataSubTotals SID_SUBTOTALS ] -SfxVoidItem Deactivate SID_OLE_DEACTIVATE -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Special; -] - - SfxVoidItem DefineDBName SID_DEFINE_DBNAME () [ @@ -1822,25 +1734,6 @@ SfxVoidItem FormatCellDialog FID_CELL_FORMAT ] -SfxStringItem Formula SID_RANGE_FORMULA - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem FreezePanes SID_WINDOW_FIX () [ @@ -2961,24 +2854,6 @@ SfxVoidItem InsertFunction SID_INS_FUNCTION ] -SfxVoidItem InsertMatrix SID_INSERT_MATRIX -(SfxStringItem Formula SID_INSERT_MATRIX) -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem AddName FID_ADD_NAME () [ @@ -3395,25 +3270,6 @@ SfxVoidItem NextPage SID_PREVIEW_NEXT ] -SfxStringItem NoteText SID_RANGE_NOTETEXT - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxBoolItem NoteVisible FID_NOTE_VISIBLE [ @@ -3741,44 +3597,6 @@ SfxVoidItem NumberFormatThousands SID_NUMBER_THOUSANDS ] -SfxInt32Item ObjectHeight SID_OBJECT_HEIGHT - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - -SfxInt32Item ObjectLeft SID_OBJECT_LEFT - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem ObjectMirrorHorizontal SID_MIRROR_HORIZONTAL () [ @@ -3815,44 +3633,6 @@ SfxVoidItem ObjectMirrorVertical SID_MIRROR_VERTICAL ] -SfxInt32Item ObjectTop SID_OBJECT_TOP - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - -SfxInt32Item ObjectWidth SID_OBJECT_WIDTH - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem OriginalSize SID_ORIGINALSIZE () [ @@ -3981,24 +3761,6 @@ SfxVoidItem ProtectTraceChangeMode SID_CHG_PROTECT ] -SfxVoidItem PutCell SID_SC_SETTEXT -(SfxInt16Item Column FN_PARAM_1,SfxInt32Item Row FN_PARAM_2,SfxInt16Item Table FN_PARAM_3,SfxStringItem Text SID_SC_SETTEXT) -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem RecalcPivotTable SID_PIVOT_RECALC () [ @@ -4331,23 +4093,6 @@ SfxVoidItem SearchAll FID_SEARCH_ALL ] -SfxVoidItem SelectArea SID_MARKAREA -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - SfxVoidItem SelectUnprotectedCells SID_SELECT_UNPROTECTED_CELLS () [ @@ -4365,24 +4110,6 @@ SfxVoidItem SelectUnprotectedCells SID_SELECT_UNPROTECTED_CELLS GroupId = SfxGroupId::Edit; ] -SfxVoidItem SelectOLE SID_OLE_SELECT -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Special; -] - - SfxVoidItem SelectColumn SID_SELECT_COL (SfxInt32Item Col FN_PARAM_1,SfxInt16Item Modifier FN_PARAM_2) [ @@ -4536,25 +4263,6 @@ SfxVoidItem ManageXMLSource SID_MANAGE_XML_SOURCE GroupId = SfxGroupId::Data; ] -SfxStringItem SelectedObjectName SID_ACTIVE_OBJ_NAME - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem SelectRow SID_SELECT_ROW (SfxInt32Item Row FN_PARAM_1,SfxInt16Item Modifier FN_PARAM_2) [ @@ -5195,25 +4903,6 @@ SfxUInt16Item StatusSelectionModeNorm SID_STATUS_SELMODE_NORM ] -SfxInt16Item Table SID_RANGE_TABLE - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxInt16Item TableCount SID_TABLES_COUNT [ @@ -5396,25 +5085,6 @@ SfxVoidItem TextToColumns SID_TEXT_TO_COLUMNS ] -SfxStringItem TextValue SID_RANGE_TEXTVALUE - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SfxVoidItem ToggleAnchorType SID_ANCHOR_TOGGLE () [ @@ -5618,25 +5288,6 @@ SfxVoidItem Validation FID_VALIDATION ] -ScDoubleItem Value SID_RANGE_VALUE - -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - - AccelConfig = FALSE, - MenuConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = SfxGroupId::Intern; -] - - SvxVerJustifyItem VerticalAlignment SID_V_ALIGNCELL [ diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 8df105eb28ec..6252fa07c51a 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -20,14 +20,6 @@ interface TableOLEObject { - SID_ACTIVE_OBJ_NAME [ StateMethod = GetObjectState; ] - SID_OLE_ACTIVATE [ ExecMethod = ExecuteObject; ] - SID_OLE_DEACTIVATE [ ExecMethod = ExecuteObject; ] - SID_OLE_SELECT [ ExecMethod = ExecuteObject; ] // api: - SID_OBJECT_LEFT [ ExecMethod = ExecuteObject; StateMethod = GetObjectState; ] - SID_OBJECT_TOP [ ExecMethod = ExecuteObject; StateMethod = GetObjectState; ] - SID_OBJECT_WIDTH [ ExecMethod = ExecuteObject; StateMethod = GetObjectState; ] - SID_OBJECT_HEIGHT [ ExecMethod = ExecuteObject; StateMethod = GetObjectState; ] } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 4647f2675f3a..0c65b5ed52ca 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -121,51 +121,6 @@ void ScDocShell::Execute( SfxRequest& rReq ) sal_uInt16 nSlot = rReq.GetSlot(); switch ( nSlot ) { - case SID_SC_SETTEXT: - { - const SfxPoolItem* pColItem; - const SfxPoolItem* pRowItem; - const SfxPoolItem* pTabItem; - const SfxPoolItem* pTextItem; - if( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pColItem ) && - pReqArgs->HasItem( FN_PARAM_2, &pRowItem ) && - pReqArgs->HasItem( FN_PARAM_3, &pTabItem ) && - pReqArgs->HasItem( SID_SC_SETTEXT, &pTextItem ) ) - { - // parameters are 1-based !!! - SCCOL nCol = static_cast<const SfxInt16Item*>(pColItem)->GetValue() - 1; - SCROW nRow = static_cast<const SfxInt32Item*>(pRowItem)->GetValue() - 1; - SCTAB nTab = static_cast<const SfxInt16Item*>(pTabItem)->GetValue() - 1; - - SCTAB nTabCount = aDocument.GetTableCount(); - if ( ValidCol(nCol) && ValidRow(nRow) && ValidTab(nTab,nTabCount) ) - { - if ( aDocument.IsBlockEditable( nTab, nCol,nRow, nCol, nRow ) ) - { - OUString aVal = static_cast<const SfxStringItem*>(pTextItem)->GetValue(); - aDocument.SetString( nCol, nRow, nTab, aVal ); - - PostPaintCell( nCol, nRow, nTab ); - SetDocumentModified(); - - rReq.Done(); - break; - } - else // protected cell - { -#if HAVE_FEATURE_SCRIPTING - SbxBase::SetError( ERRCODE_BASIC_BAD_PARAMETER ); //! which error ? -#endif - break; - } - } - } -#if HAVE_FEATURE_SCRIPTING - SbxBase::SetError( ERRCODE_BASIC_NO_OBJECT ); -#endif - } - break; - case SID_SBA_IMPORT: { if (pReqArgs) @@ -556,10 +511,6 @@ void ScDocShell::Execute( SfxRequest& rReq ) } break; - case SID_AUTO_STYLE: - OSL_FAIL("use ScAutoStyleHint instead of SID_AUTO_STYLE"); - break; - case SID_GET_COLORLIST: { const SvxColorListItem* pColItem = static_cast<const SvxColorListItem*>(GetItem(SID_COLOR_TABLE)); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 92b389504b99..c35cb1759726 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -676,27 +676,6 @@ void ScCellShell::GetState(SfxItemSet &rSet) rSet.DisableItem( nWhich ); break; - case SID_RANGE_ADDRESS: - { - ScRange aRange; - if ( pData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE ) - { - OUString aStr(aRange.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D,pDoc)); - rSet.Put( SfxStringItem( nWhich, aStr ) ); - } - } - break; - - case SID_RANGE_NOTETEXT: - { - // always take cursor position, do not use top-left cell of selection - OUString aNoteText; - if ( const ScPostIt* pNote = pDoc->GetNote(nPosX, nPosY, nTab) ) - aNoteText = pNote->GetText(); - rSet.Put( SfxStringItem( nWhich, aNoteText ) ); - } - break; - case SID_RANGE_ROW: rSet.Put( SfxInt32Item( nWhich, nPosY+1 ) ); break; @@ -705,37 +684,6 @@ void ScCellShell::GetState(SfxItemSet &rSet) rSet.Put( SfxInt16Item( nWhich, nPosX+1 ) ); break; - case SID_RANGE_TABLE: - rSet.Put( SfxInt16Item( nWhich, nTab+1 ) ); - break; - - case SID_RANGE_VALUE: - { - double nValue; - pDoc->GetValue( nPosX, nPosY, nTab, nValue ); - rSet.Put( ScDoubleItem( nWhich, nValue ) ); - } - break; - - case SID_RANGE_FORMULA: - { - OUString aString; - pDoc->GetFormula( nPosX, nPosY, nTab, aString ); - if( aString.isEmpty() ) - { - pDoc->GetInputString( nPosX, nPosY, nTab, aString ); - } - rSet.Put( SfxStringItem( nWhich, aString ) ); - } - break; - - case SID_RANGE_TEXTVALUE: - { - OUString aString = pDoc->GetString(nPosX, nPosY, nTab); - rSet.Put( SfxStringItem( nWhich, aString ) ); - } - break; - case SID_STATUS_SELMODE: { /* 0: STD Click cancels Sel diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 06e61d3ec47f..8f0063986168 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2209,18 +2209,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; - case SID_RANGE_NOTETEXT: - if (pReqArgs) - { - const SfxStringItem& rTextItem = static_cast<const SfxStringItem&>(pReqArgs->Get( SID_RANGE_NOTETEXT )); - - // always cursor position - ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); - pTabViewShell->SetNoteText( aPos, rTextItem.GetValue() ); - rReq.Done(); - } - break; - case SID_INSERT_POSTIT: case SID_EDIT_POSTIT: { diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index f0a77deca879..e40fb5f17fd3 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -210,19 +210,6 @@ void ScCellShell::Execute( SfxRequest& rReq ) } break; - case SID_INSERT_MATRIX: - { - if ( pReqArgs ) - { - OUString aStr = static_cast<const SfxStringItem&>(pReqArgs-> - Get( SID_INSERT_MATRIX )).GetValue(); - ScDocument* pDoc = GetViewData()->GetDocument(); - pTabViewShell->EnterMatrix( aStr, pDoc->GetGrammar() ); - rReq.Done(); - } - } - break; - case FID_INPUTLINE_ENTER: case FID_INPUTLINE_BLOCK: case FID_INPUTLINE_MATRIX: @@ -928,11 +915,6 @@ void ScCellShell::Execute( SfxRequest& rReq ) SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD ); break; - case SID_MARKAREA: - // called from Basic at the hidden view to select a range in the visible view - OSL_FAIL("old slot SID_MARKAREA"); - break; - default: OSL_FAIL("ScCellShell::Execute: unknown slot"); break; diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index ddd1ef663525..f3895ca0e84c 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -567,13 +567,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) rReq.Done(); break; - // SID_TABLE_ACTIVATE and SID_MARKAREA are called by basic for the - // hidden View, to mark/switch on the visible View: - - case SID_TABLE_ACTIVATE: - OSL_FAIL("old slot SID_TABLE_ACTIVATE"); - break; - case SID_REPAINT: PaintGrid(); PaintTop(); diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index c59e6dcc4e6c..1b45a21da434 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -41,169 +41,12 @@ using namespace com::sun::star; -void ScTabViewShell::ExecuteObject( const SfxRequest& rReq ) +void ScTabViewShell::ExecuteObject( const SfxRequest& /*rReq*/ ) { - sal_uInt16 nSlotId = rReq.GetSlot(); - const SfxItemSet* pReqArgs = rReq.GetArgs(); - - // Always activate/deactivate object in the visible View - - ScTabViewShell* pVisibleSh = this; - if ( nSlotId == SID_OLE_SELECT || nSlotId == SID_OLE_ACTIVATE || nSlotId == SID_OLE_DEACTIVATE ) - { - OSL_FAIL("old slot SID_OLE..."); - } - - switch (nSlotId) - { - case SID_OLE_SELECT: - case SID_OLE_ACTIVATE: - { - // In both cases, first select in the visible View - - OUString aName; - SdrView* pDrView = GetSdrView(); - if (pDrView) - { - const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - if (rMarkList.GetMarkCount() == 1) - aName = ScDrawLayer::GetVisibleName( rMarkList.GetMark(0)->GetMarkedSdrObj() ); - } - pVisibleSh->SelectObject( aName ); - - // activate - - if ( nSlotId == SID_OLE_ACTIVATE ) - pVisibleSh->DoVerb( 0 ); - } - break; - case SID_OLE_DEACTIVATE: - pVisibleSh->DeactivateOle(); - break; - - case SID_OBJECT_LEFT: - case SID_OBJECT_TOP: - case SID_OBJECT_WIDTH: - case SID_OBJECT_HEIGHT: - { - bool bDone = false; - const SfxPoolItem* pItem; - if ( pReqArgs && pReqArgs->GetItemState( nSlotId, true, &pItem ) == SfxItemState::SET ) - { - long nNewVal = static_cast<const SfxInt32Item*>(pItem)->GetValue(); - if ( nNewVal < 0 ) - nNewVal = 0; - - //! convert from something into 1/100mm ?????? - - SdrView* pDrView = GetSdrView(); - if ( pDrView ) - { - const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - if (rMarkList.GetMarkCount() == 1) - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - tools::Rectangle aRect = pObj->GetLogicRect(); - - if ( nSlotId == SID_OBJECT_LEFT ) - pDrView->MoveMarkedObj( Size( nNewVal - aRect.Left(), 0 ) ); - else if ( nSlotId == SID_OBJECT_TOP ) - pDrView->MoveMarkedObj( Size( 0, nNewVal - aRect.Top() ) ); - else if ( nSlotId == SID_OBJECT_WIDTH ) - pDrView->ResizeMarkedObj( aRect.TopLeft(), - Fraction( nNewVal, aRect.GetWidth() ), - Fraction( 1, 1 ) ); - else // if ( nSlotId == SID_OBJECT_HEIGHT ) - pDrView->ResizeMarkedObj( aRect.TopLeft(), - Fraction( 1, 1 ), - Fraction( nNewVal, aRect.GetHeight() ) ); - bDone = true; - } - } - } -#if HAVE_FEATURE_SCRIPTING - if (!bDone) - SbxBase::SetError( ERRCODE_BASIC_BAD_PARAMETER ); // basic error -#endif - } - break; - - } } -static uno::Reference < embed::XEmbeddedObject > lcl_GetSelectedObj( const SdrView* pDrView ) //! member of ScDrawView? +void ScTabViewShell::GetObjectState( SfxItemSet& /*rSet*/ ) { - uno::Reference < embed::XEmbeddedObject > xRet; - if (pDrView) - { - const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - if (rMarkList.GetMarkCount() == 1) - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() == OBJ_OLE2) - { - SdrOle2Obj* pOle2Obj = static_cast<SdrOle2Obj*>(pObj); - xRet = pOle2Obj->GetObjRef(); - } - } - } - - return xRet; -} - -void ScTabViewShell::GetObjectState( SfxItemSet& rSet ) -{ - SfxWhichIter aIter(rSet); - sal_uInt16 nWhich = aIter.FirstWhich(); - while ( nWhich ) - { - switch (nWhich) - { - case SID_ACTIVE_OBJ_NAME: - { - OUString aName; - uno::Reference < embed::XEmbeddedObject > xOLE = lcl_GetSelectedObj( GetSdrView() ); - if (xOLE.is()) - { - aName = GetViewData().GetSfxDocShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xOLE ); - } - rSet.Put( SfxStringItem( nWhich, aName ) ); - } - break; - case SID_OBJECT_LEFT: - case SID_OBJECT_TOP: - case SID_OBJECT_WIDTH: - case SID_OBJECT_HEIGHT: - { - SdrView* pDrView = GetSdrView(); - if ( pDrView ) - { - const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - if (rMarkList.GetMarkCount() == 1) - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - tools::Rectangle aRect = pObj->GetLogicRect(); - - long nVal; - if ( nWhich == SID_OBJECT_LEFT ) - nVal = aRect.Left(); - else if ( nWhich == SID_OBJECT_TOP ) - nVal = aRect.Top(); - else if ( nWhich == SID_OBJECT_WIDTH ) - nVal = aRect.GetWidth(); - else // if ( nWhich == SID_OBJECT_HEIGHT ) - nVal = aRect.GetHeight(); - - //! convert from 1/100mm to something else ?????? - - rSet.Put( SfxInt32Item( nWhich, nVal ) ); - } - } - } - break; - } - nWhich = aIter.NextWhich(); - } } void ScTabViewShell::AddAccessibilityObject( SfxListener& rObject ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits