diff options
author | Martin van Zijl <martin.vanzijl@gmail.com> | 2018-12-26 07:21:59 +1300 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-27 16:54:53 +0100 |
commit | a80317b602e175f780cd662b5526a538d053419a (patch) | |
tree | b916d77e36a21c8034534e11b53491a5149377e7 | |
parent | b7bc2105d5093543058716c12e4d88dffb00b752 (diff) |
tdf#60242 remember horizontal/vertical choice in split cells dialog
Change-Id: I25f6b7c8ff6aa678b597bbede0dd1492468f2f62
Reviewed-on: https://gerrit.libreoffice.org/65606
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | cui/source/dialogs/splitcelldlg.cxx | 6 | ||||
-rw-r--r-- | cui/source/inc/splitcelldlg.hxx | 1 | ||||
-rw-r--r-- | include/svx/svxdlg.hxx | 1 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Writer.xcs | 7 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs | 7 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/modcfg.hxx | 8 | ||||
-rw-r--r-- | sw/inc/swmodule.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodul1.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/config/modcfg.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/inc/wrtsh.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/select.cxx | 10 |
14 files changed, 78 insertions, 1 deletions
diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx index 903c998bb526..6c9a7443c54e 100644 --- a/cui/source/dialogs/splitcelldlg.cxx +++ b/cui/source/dialogs/splitcelldlg.cxx @@ -83,4 +83,10 @@ short SvxSplitTableDlg::Execute() return run(); } +void SvxSplitTableDlg::SetSplitVerticalByDefault() +{ + if( mnMaxVertical >= 2 ) + m_xVertBox->set_active(true); // tdf#60242 +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx index 9b4c1f34c668..b0c2fddae3c7 100644 --- a/cui/source/inc/splitcelldlg.hxx +++ b/cui/source/inc/splitcelldlg.hxx @@ -43,6 +43,7 @@ public: virtual long GetCount() const override; virtual short Execute() override; + virtual void SetSplitVerticalByDefault() override; }; #endif diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 8547dc306e1b..2a50a9ccde03 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -295,6 +295,7 @@ public: virtual bool IsHorizontal() const = 0; virtual bool IsProportional() const = 0; virtual long GetCount() const = 0; + virtual void SetSplitVerticalByDefault() = 0; }; class SvxAbstractNewTableDialog : public VclAbstractDialog diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index d18a5469079c..3b147dcfd25d 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -2308,6 +2308,13 @@ </info> <value>true</value> </prop> + <prop oor:name="SplitVerticalByDefault" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies whether cells should be split vertically by default.</desc> + <label>Split vertically by default</label> + </info> + <value>false</value> + </prop> </group> </group> <group oor:name="Cursor"> diff --git a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs index cd655115ac99..917751492689 100644 --- a/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/WriterWeb.xcs @@ -869,6 +869,13 @@ </info> <value>false</value> </prop> + <prop oor:name="SplitVerticalByDefault" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies whether cells should be split vertically by default.</desc> + <label>Split vertically by default</label> + </info> + <value>false</value> + </prop> </group> </group> <group oor:name="Insert"> diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 3ebbec5e1cc2..9bba13ef17be 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1197,6 +1197,8 @@ public: bool IsInsTableFormatNum() const; bool IsInsTableChangeNumFormat() const; bool IsInsTableAlignNum() const; + bool IsSplitVerticalByDefault() const; + void SetSplitVerticalByDefault(bool value); // From FEShell (for Undo and BModified). static void GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame ); diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index 550cb1c332be..795d1f382fdc 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -155,6 +155,7 @@ class SwTableConfig : public utl::ConfigItem bool m_bInsTableFormatNum; // Table/Input/NumberRecognition // Automatic recognition of numbers. bool m_bInsTableChangeNumFormat; // Table/Input/NumberFormatRecognition // Automatic recognition of number formats. bool m_bInsTableAlignNum; // Table/Input/Alignment // Align numbers. + bool m_bSplitVerticalByDefault; // Table/Input/SplitVerticalByDefault // Split vertical by default. static const css::uno::Sequence<OUString>& GetPropertyNames(); @@ -303,6 +304,13 @@ public: config.m_aInsTableOpts = rOpts; config.SetModified();} + bool IsSplitVerticalByDefault(bool bHTML) const + { return bHTML ? m_aWebTableConfig.m_bSplitVerticalByDefault : m_aTableConfig.m_bSplitVerticalByDefault; } + void SetSplitVerticalByDefault(bool bHTML, bool b) + { auto & config = bHTML ? m_aWebTableConfig : m_aTableConfig; + config.m_bSplitVerticalByDefault = b; + config.SetModified();} + const InsCaptionOpt* GetCapOption(bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId); bool SetCapOption(bool bHTML, const InsCaptionOpt* pOpt); diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index eec00ab2f3e5..4e4577f3fc10 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -191,6 +191,8 @@ public: bool IsInsTableFormatNum(bool bHTML) const; bool IsInsTableChangeNumFormat(bool bHTML) const; bool IsInsTableAlignNum(bool bHTML) const; + bool IsSplitVerticalByDefault(bool bHTML) const; + void SetSplitVerticalByDefault(bool bHTML, bool value); // Redlining. std::size_t GetRedlineAuthor(); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index fb544a775b0c..d25cf80ad5fc 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1706,6 +1706,16 @@ bool SwDoc::IsInsTableAlignNum() const return SW_MOD()->IsInsTableAlignNum(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); } +bool SwDoc::IsSplitVerticalByDefault() const +{ + return SW_MOD()->IsSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); +} + +void SwDoc::SetSplitVerticalByDefault(bool value) +{ + SW_MOD()->SetSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE), value); +} + /// Set up the InsertDB as Undo table void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, bool bIsTable ) { diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index a76477be082f..1d9c83a45ea5 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -572,6 +572,16 @@ bool SwModule::IsInsTableAlignNum(bool bHTML) const return m_pModuleConfig->IsInsTableAlignNum(bHTML); } +bool SwModule::IsSplitVerticalByDefault(bool bHTML) const +{ + return m_pModuleConfig->IsSplitVerticalByDefault(bHTML); +} + +void SwModule::SetSplitVerticalByDefault(bool bHTML, bool value) +{ + m_pModuleConfig->SetSplitVerticalByDefault(bHTML, value); +} + const Color &SwModule::GetRedlineMarkColor() { return m_pModuleConfig->GetMarkAlignColor(); diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index ea2d83bc111a..7c9a027ed031 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -1075,7 +1075,8 @@ const Sequence<OUString>& SwTableConfig::GetPropertyNames() "Change/Effect", // 4 "Input/NumberRecognition", // 5 "Input/NumberFormatRecognition",// 6 - "Input/Alignment" // 7 + "Input/Alignment", // 7 + "Input/SplitVerticalByDefault" // 8 }; return aNames; } @@ -1091,6 +1092,7 @@ SwTableConfig::SwTableConfig(bool bWeb) , m_bInsTableFormatNum(false) , m_bInsTableChangeNumFormat(false) , m_bInsTableAlignNum(false) + , m_bSplitVerticalByDefault(false) { Load(); } @@ -1119,6 +1121,7 @@ void SwTableConfig::ImplCommit() case 5 : pValues[nProp] <<= m_bInsTableFormatNum; break; //"Input/NumberRecognition", case 6 : pValues[nProp] <<= m_bInsTableChangeNumFormat; break; //"Input/NumberFormatRecognition", case 7 : pValues[nProp] <<= m_bInsTableAlignNum; break; //"Input/Alignment" + case 8 : pValues[nProp] <<= m_bSplitVerticalByDefault; break; //"Input/SplitVerticalByDefault" } } PutProperties(aNames, aValues); @@ -1145,6 +1148,7 @@ void SwTableConfig::Load() case 5 : m_bInsTableFormatNum = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/NumberRecognition", case 6 : m_bInsTableChangeNumFormat = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/NumberFormatRecognition", case 7 : m_bInsTableAlignNum = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/Alignment" + case 8 : m_bSplitVerticalByDefault = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/SplitVerticalByDefault" } } } diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 0a9ee03e3876..7d01662075bc 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -115,6 +115,9 @@ public: void EndDrag (const Point* pPt, bool bProp) { (this->*m_fnEndDrag)(pPt, bProp); } long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); } + bool IsSplitVerticalByDefault() const; + void SetSplitVerticalByDefault(bool value); + // reset all selections long ResetSelect( const Point *, bool ); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 54f6b9d3f2cb..4333c01637f3 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -985,6 +985,8 @@ void SwTableShell::Execute(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY; ScopedVclPtr<SvxAbstractSplitTableDialog> pDlg(pFact->CreateSvxSplitTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert)); + if(rSh.IsSplitVerticalByDefault()) + pDlg->SetSplitVerticalByDefault(); if( pDlg->Execute() == RET_OK ) { nCount = pDlg->GetCount(); @@ -993,6 +995,10 @@ void SwTableShell::Execute(SfxRequest &rReq) rReq.AppendItem( SfxInt32Item( FN_TABLE_SPLIT_CELLS, nCount ) ); rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bHorizontal ) ); rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bProportional ) ); + + // tdf#60242: remember choice for next time + bool bVerticalWasChecked = !pDlg->IsHorizontal(); + rSh.SetSplitVerticalByDefault(bVerticalWasChecked); } } diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index e2739a29023a..88db0132900b 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -364,6 +364,16 @@ long SwWrtShell::ResetSelect(const Point *,bool) return 1; } +bool SwWrtShell::IsSplitVerticalByDefault() const +{ + return GetDoc()->IsSplitVerticalByDefault(); +} + +void SwWrtShell::SetSplitVerticalByDefault(bool value) +{ + GetDoc()->SetSplitVerticalByDefault(value); +} + // Do nothing long SwWrtShell::Ignore(const Point *, bool ) { |