diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-01-22 17:47:04 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-26 21:12:17 +0100 |
commit | b5f8b046008a27f1da58b934dbe61c0decf36612 (patch) | |
tree | ffcf7ac5f8552feeeacf43579b6d80158acee563 | |
parent | c48dd8ee185b24322ce497ee74896c7288db008e (diff) |
tdf#98931 Add option to sort boundary image-only columns
A similiar option exists for comments-only columns.
If enabled, image-only columns are considered when sorting (and selected).
This is the default behavior, but can now be disabled.
Change-Id: Ie9dfdf913ea5904480c96375beb4e25bcb880785
Reviewed-on: https://gerrit.libreoffice.org/48351
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/inc/sortparam.hxx | 1 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 2 | ||||
-rw-r--r-- | sc/source/core/data/sortparam.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tpsort.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 1 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/sortoptionspage.ui | 40 |
10 files changed, 53 insertions, 15 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index e4823e58ff44..71be34add605 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -625,6 +625,7 @@ #define SID_SORT_USERDEF (SC_PARAM_START+4) #define SID_SORT_NATURALSORT (SC_PARAM_START+5) #define SID_SORT_INCCOMMENTS (SC_PARAM_START+6) +#define SID_SORT_INCIMAGES (SC_PARAM_START+7) // Sidebar ------------------------------------------------------------- diff --git a/sc/inc/sortparam.hxx b/sc/inc/sortparam.hxx index d0cd0204d518..6eba07e64487 100644 --- a/sc/inc/sortparam.hxx +++ b/sc/inc/sortparam.hxx @@ -50,6 +50,7 @@ struct SC_DLLPUBLIC ScSortParam bool bCaseSens; bool bNaturalSort; bool bIncludeComments; + bool bIncludeGraphicObjects; bool bUserDef; bool bIncludePattern; bool bInplace; diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index f238b4633721..216aeebc7bc9 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1094,7 +1094,7 @@ SfxVoidItem DataSelect SID_DATA_SELECT SfxVoidItem DataSort SID_SORT -(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6,SfxBoolItem IncludeComments SID_SORT_INCCOMMENTS) +(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6,SfxBoolItem IncludeComments SID_SORT_INCCOMMENTS, SfxBoolItem IncludeImages SID_SORT_INCIMAGES) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index 98033816ece5..cd98dd07a982 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -35,7 +35,8 @@ ScSortParam::ScSortParam() ScSortParam::ScSortParam( const ScSortParam& r ) : nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nUserIndex(r.nUserIndex), bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens), - bNaturalSort(r.bNaturalSort),bIncludeComments(r.bIncludeComments),bUserDef(r.bUserDef), + bNaturalSort(r.bNaturalSort),bIncludeComments(r.bIncludeComments), + bIncludeGraphicObjects(r.bIncludeGraphicObjects),bUserDef(r.bUserDef), bIncludePattern(r.bIncludePattern),bInplace(r.bInplace), nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow), maKeyState( r.maKeyState ), @@ -57,6 +58,7 @@ void ScSortParam::Clear() nUserIndex = 0; bHasHeader=bCaseSens=bUserDef=bNaturalSort = false; bIncludeComments = false; + bIncludeGraphicObjects = true; bByRow=bIncludePattern=bInplace = true; aCollatorLocale = css::lang::Locale(); aCollatorAlgorithm.clear(); @@ -81,6 +83,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r ) bCaseSens = r.bCaseSens; bNaturalSort = r.bNaturalSort; bIncludeComments= r.bIncludeComments; + bIncludeGraphicObjects = r.bIncludeGraphicObjects; bUserDef = r.bUserDef; bIncludePattern = r.bIncludePattern; bInplace = r.bInplace; @@ -125,6 +128,7 @@ bool ScSortParam::operator==( const ScSortParam& rOther ) const && (bCaseSens == rOther.bCaseSens) && (bNaturalSort == rOther.bNaturalSort) && (bIncludeComments== rOther.bIncludeComments) + && (bIncludeGraphicObjects == rOther.bIncludeGraphicObjects) && (bUserDef == rOther.bUserDef) && (nUserIndex == rOther.nUserIndex) && (bIncludePattern == rOther.bIncludePattern) @@ -153,7 +157,8 @@ bool ScSortParam::operator==( const ScSortParam& rOther ) const ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) : nCol1(rSub.nCol1),nRow1(rSub.nRow1),nCol2(rSub.nCol2),nRow2(rSub.nRow2),nUserIndex(rSub.nUserIndex), bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort), - bIncludeComments(rOld.bIncludeComments),bUserDef(rSub.bUserDef),bIncludePattern(rSub.bIncludePattern), + bIncludeComments(rOld.bIncludeComments),bIncludeGraphicObjects(rOld.bIncludeGraphicObjects), + bUserDef(rSub.bUserDef),bIncludePattern(rSub.bIncludePattern), bInplace(true), nDestTab(0),nDestCol(0),nDestRow(0), aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ), @@ -196,7 +201,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld ) ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) : nCol1(nCol),nRow1(rParam.nRow1),nCol2(nCol),nRow2(rParam.nRow2),nUserIndex(0), bHasHeader(rParam.bHasHeader),bByRow(true),bCaseSens(rParam.bCaseSens), - bNaturalSort(false),bIncludeComments(false), + bNaturalSort(false),bIncludeComments(false),bIncludeGraphicObjects(true), //TODO: what about Locale and Algorithm? bUserDef(false),bIncludePattern(false), bInplace(true), diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 7cdf814c77b0..9ad1b3898960 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -505,6 +505,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( vcl::Window* pParent, get(m_pBtnFormats, "formats"); get(m_pBtnNaturalSort, "naturalsort"); get(m_pBtnIncComments, "includenotes"); + get(m_pBtnIncImages, "includeimages"); get(m_pBtnCopyResult, "copyresult"); get(m_pLbOutPos, "outarealb"); get(m_pEdOutPos, "outareaed"); @@ -538,6 +539,7 @@ void ScTabPageSortOptions::dispose() m_pBtnFormats.clear(); m_pBtnNaturalSort.clear(); m_pBtnIncComments.clear(); + m_pBtnIncImages.clear(); m_pBtnCopyResult.clear(); m_pLbOutPos.clear(); m_pEdOutPos.clear(); @@ -660,6 +662,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet* /* rArgSet */ ) m_pBtnHeader->Check ( aSortData.bHasHeader ); m_pBtnNaturalSort->Check ( aSortData.bNaturalSort ); m_pBtnIncComments->Check ( aSortData.bIncludeComments ); + m_pBtnIncImages->Check ( aSortData.bIncludeGraphicObjects ); if ( aSortData.bByRow ) { @@ -725,6 +728,7 @@ bool ScTabPageSortOptions::FillItemSet( SfxItemSet* rArgSet ) aNewSortData.bCaseSens = m_pBtnCase->IsChecked(); aNewSortData.bNaturalSort = m_pBtnNaturalSort->IsChecked(); aNewSortData.bIncludeComments= m_pBtnIncComments->IsChecked(); + aNewSortData.bIncludeGraphicObjects = m_pBtnIncImages->IsChecked(); aNewSortData.bIncludePattern = m_pBtnFormats->IsChecked(); aNewSortData.bInplace = !m_pBtnCopyResult->IsChecked(); aNewSortData.nDestCol = theOutPos.Col(); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 125d915d36cc..50e0f5b514e6 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -516,7 +516,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, bool bShrunk = false; rDoc.ShrinkToUsedDataArea( bShrunk, nTab, aLocalParam.nCol1, aLocalParam.nRow1, aLocalParam.nCol2, aLocalParam.nRow2, false, aLocalParam.bByRow, !aLocalParam.bByRow, - aLocalParam.bIncludeComments, true ); + aLocalParam.bIncludeComments, aLocalParam.bIncludeGraphicObjects ); SCROW nStartRow = aLocalParam.nRow1; if (aLocalParam.bByRow && aLocalParam.bHasHeader && nStartRow < aLocalParam.nRow2) diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx index 9c79b8020daf..1438693455ff 100644 --- a/sc/source/ui/inc/tpsort.hxx +++ b/sc/source/ui/inc/tpsort.hxx @@ -143,6 +143,7 @@ private: VclPtr<RadioButton> m_pBtnLeftRight; VclPtr<CheckBox> m_pBtnIncComments; + VclPtr<CheckBox> m_pBtnIncImages; OUString aStrRowLabel; OUString aStrColLabel; diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index cfd3a4cbe28a..0546f2abc244 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -380,6 +380,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aSortParam.bCaseSens = false; aSortParam.bNaturalSort = false; aSortParam.bIncludeComments = false; + aSortParam.bIncludeGraphicObjects = true; aSortParam.bIncludePattern = true; aSortParam.bInplace = true; aSortParam.maKeyState[0].bDoSort = true; @@ -433,6 +434,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aSortParam.bNaturalSort = static_cast<const SfxBoolItem*>(pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_INCCOMMENTS, true, &pItem ) == SfxItemState::SET ) aSortParam.bIncludeComments = static_cast<const SfxBoolItem*>(pItem)->GetValue(); + if ( pArgs->GetItemState( SID_SORT_INCIMAGES, true, &pItem ) == SfxItemState::SET ) + aSortParam.bIncludeGraphicObjects = static_cast<const SfxBoolItem*>(pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_ATTRIBS, true, &pItem ) == SfxItemState::SET ) aSortParam.bIncludePattern = static_cast<const SfxBoolItem*>(pItem)->GetValue(); if ( pArgs->GetItemState( SID_SORT_USERDEF, true, &pItem ) == SfxItemState::SET ) @@ -519,6 +522,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) rOutParam.bNaturalSort ) ); rReq.AppendItem( SfxBoolItem( SID_SORT_INCCOMMENTS, rOutParam.bIncludeComments ) ); + rReq.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES, + rOutParam.bIncludeGraphicObjects ) ); rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, rOutParam.bIncludePattern ) ); sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 84ad31b969da..f64f9e932e79 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -754,6 +754,7 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode) aSortParam.bCaseSens = false; aSortParam.bNaturalSort = false; aSortParam.bIncludeComments = false; + aSortParam.bIncludeGraphicObjects = true; aSortParam.bIncludePattern = true; aSortParam.bInplace = true; aSortParam.maKeyState[0].bDoSort = true; diff --git a/sc/uiconfig/scalc/ui/sortoptionspage.ui b/sc/uiconfig/scalc/ui/sortoptionspage.ui index 90300e8b5241..aab54bf0d0a7 100644 --- a/sc/uiconfig/scalc/ui/sortoptionspage.ui +++ b/sc/uiconfig/scalc/ui/sortoptionspage.ui @@ -99,6 +99,20 @@ </packing> </child> <child> + <object class="GtkCheckButton" id="includeimages"> + <property name="label" translatable="yes" context="sortoptionspage|includeimages">Include boundary column(s) containing only images</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="copyresult"> <property name="label" translatable="yes" context="sortoptionspage|copyresult">Copy sort results to:</property> <property name="visible">True</property> @@ -112,7 +126,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -126,13 +140,13 @@ </accessibility> <child internal-child="accessible"> <object class="AtkObject" id="outarealb-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="sortoptionspage|outarealb-atkobject">Copy sort results to:</property> + <property name="AtkObject::accessible-name" translatable="yes" context="sortoptionspage|outarealb-atkobject">Copy sort results to:</property> </object> </child> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -152,7 +166,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -169,7 +183,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> </packing> </child> <child> @@ -189,7 +203,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">8</property> + <property name="top_attach">9</property> <property name="width">2</property> </packing> </child> @@ -204,7 +218,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">9</property> + <property name="top_attach">10</property> </packing> </child> <child> @@ -218,7 +232,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">9</property> + <property name="top_attach">10</property> </packing> </child> <child> @@ -228,7 +242,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">10</property> + <property name="top_attach">11</property> </packing> </child> <child> @@ -238,7 +252,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">10</property> + <property name="top_attach">11</property> </packing> </child> <child> @@ -259,6 +273,12 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> </object> |