diff options
author | Sujatro Bhadra <sujatrobhadra@gmail.com> | 2024-03-21 18:07:40 +0530 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2024-04-12 12:40:37 +0200 |
commit | 1dd7cc9446233f047ace02f4275ef6405587b9c9 (patch) | |
tree | 5c53f01665168ba5485ca574d7b601c987be43fb | |
parent | 34c698fe1bf26fd6b01a62df2f847ab05536c215 (diff) |
tdf#116091: Replaced 'AutoFormat' Button in Convert Text to Table dialog
Change-Id: If8eee099e79e65d5a6ca1b06d1cfb2a71bbe52f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165099
Tested-by: Jenkins
Reviewed-by: Sujatro Bhadra <sujatrobhadra@gmail.com>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/table/convert.cxx | 184 | ||||
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 139 | ||||
-rw-r--r-- | sw/source/uibase/inc/convert.hxx | 42 | ||||
-rw-r--r-- | sw/source/uibase/inc/tautofmt.hxx | 32 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/converttexttable.ui | 1083 |
8 files changed, 957 insertions, 532 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 019684b11317..fac76ae5c571 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -280,6 +280,8 @@ public: virtual void GetValues( sal_Unicode& rDelim, SwInsertTableOptions& rInsTableFlags, SwTableAutoFormat const*& prTAFormat ) = 0; + virtual std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const = 0; + virtual void Apply() = 0; }; class AbstractSwInsertDBColAutoPilot : public VclAbstractDialog diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 8275f5e65a1d..415bf658b3c3 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -647,6 +647,11 @@ void AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_Int32 nIdx) m_xDlg->SelectEntryPos( nIdx ); } +std::unique_ptr<SwTableAutoFormat> AbstractSwConvertTableDlg_Impl::FillAutoFormatOfIndex() const +{ + return m_xDlg->FillAutoFormatOfIndex(); +} + std::unique_ptr<SwTableAutoFormat> AbstractSwAutoFormatDlg_Impl::FillAutoFormatOfIndex() const { return m_xDlg->FillAutoFormatOfIndex(); diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 5d8035b6bfcd..f94342e23b31 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -353,6 +353,8 @@ public: virtual short Execute() override; virtual void GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTableFlags, SwTableAutoFormat const*& prTAFormat) override; + virtual std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const override; + virtual void Apply() override { m_xDlg->Apply(); } }; class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPilot diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 3f7a55ad1936..65a42f227892 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -31,6 +31,11 @@ #include <swuiexp.hxx> #include <memory> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> +#include <sal/log.hxx> +#include <shellres.hxx> + //keep the state of the buttons on runtime static int nSaveButtonState = -1; // 0: tab, 1: semicolon, 2: paragraph, 3: other, -1: not yet used static bool bIsKeepColumn = true; @@ -87,6 +92,18 @@ void SwConvertTableDlg::GetValues(sal_Unicode& rDelim, SwInsertTableOptions& rIn SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable) : SfxDialogController(rView.GetFrameWeld(), "modules/swriter/ui/converttexttable.ui", "ConvertTextTableDialog") + , m_aStrTitle(SwResId(STR_ADD_AUTOFORMAT_TITLE)) + , m_aStrLabel(SwResId(STR_ADD_AUTOFORMAT_LABEL)) + , m_aStrClose(SwResId(STR_BTN_AUTOFORMAT_CLOSE)) + , m_aStrDelTitle(SwResId(STR_DEL_AUTOFORMAT_TITLE)) + , m_aStrDelMsg(SwResId(STR_DEL_AUTOFORMAT_MSG)) + , m_aStrRenameTitle(SwResId(STR_RENAME_AUTOFORMAT_TITLE)) + , m_aStrInvalidFormat(SwResId(STR_INVALID_AUTOFORMAT_NAME)) + , m_nIndex(0) + , m_nDfltStylePos(0) + , m_bCoreDataChanged(false) + , m_bSetAutoFormat(false) + , m_xTableTable(new SwTableAutoFormatTable) , m_xTabBtn(m_xBuilder->weld_radio_button("tabs")) , m_xSemiBtn(m_xBuilder->weld_radio_button("semicolons")) , m_xParaBtn(m_xBuilder->weld_radio_button("paragraph")) @@ -99,9 +116,23 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable) , m_xRepeatRows(m_xBuilder->weld_container("repeatrows")) , m_xRepeatHeaderNF(m_xBuilder->weld_spin_button("repeatheadersb")) , m_xDontSplitCB(m_xBuilder->weld_check_button("dontsplitcb")) - , m_xAutoFormatBtn(m_xBuilder->weld_button("autofmt")) + , m_xLbFormat(m_xBuilder->weld_tree_view("formatlb")) + , m_xBtnNumFormat(m_xBuilder->weld_check_button("numformatcb")) + , m_xBtnBorder(m_xBuilder->weld_check_button("bordercb")) + , m_xBtnFont(m_xBuilder->weld_check_button("fontcb")) + , m_xBtnPattern(m_xBuilder->weld_check_button("patterncb")) + , m_xBtnAlignment(m_xBuilder->weld_check_button("alignmentcb")) + , m_xWndPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aWndPreview)) , m_pShell(&rView.GetWrtShell()) { + m_aWndPreview.DetectRTL(&rView.GetWrtShell()); + m_xTableTable->Load(); + + const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32; + const int nHeight = m_xLbFormat->get_height_rows(8); + m_xLbFormat->set_size_request(nWidth, nHeight); + m_xWndPreview->set_size_request(nWidth, nHeight); + if (nSaveButtonState > -1) { switch (nSaveButtonState) @@ -126,8 +157,6 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable) if (bToTable) { m_xDialog->set_title(SwResId(STR_CONVERT_TEXT_TABLE)); - m_xAutoFormatBtn->connect_clicked(LINK(this, SwConvertTableDlg, AutoFormatHdl)); - m_xAutoFormatBtn->show(); m_xKeepColumn->show(); m_xKeepColumn->set_sensitive(m_xTabBtn->get_active()); } @@ -160,22 +189,151 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable) m_xRepeatHeaderCB->connect_toggled(LINK(this, SwConvertTableDlg, RepeatHeaderCheckBoxHdl)); RepeatHeaderCheckBoxHdl(*m_xRepeatHeaderCB); CheckBoxHdl(*m_xHeaderCB); + Init(); +} + +SwConvertTableDlg::~SwConvertTableDlg() +{ + try + { + if (m_bCoreDataChanged) + m_xTableTable->Save(); + } + catch (...) + { + } + m_xTableTable.reset(); +} + +void SwConvertTableDlg::Init() +{ + const SwTableAutoFormat* pSelFormat = mxTAutoFormat.get(); + Link<weld::Toggleable&, void> aLk(LINK(this, SwConvertTableDlg, CheckHdl)); + m_xBtnBorder->connect_toggled(aLk); + m_xBtnFont->connect_toggled(aLk); + m_xBtnPattern->connect_toggled(aLk); + m_xBtnAlignment->connect_toggled(aLk); + m_xBtnNumFormat->connect_toggled(aLk); + + m_xLbFormat->connect_changed(LINK(this, SwConvertTableDlg, SelFormatHdl)); + + m_nIndex = 0; + if (!m_bSetAutoFormat) + { + // Then the list to be expanded by the entry "- none -". + m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone); + m_nDfltStylePos = 1; + m_nIndex = 255; + } + + for (sal_uInt8 i = 0, nCount = static_cast<sal_uInt8>(m_xTableTable->size()); i < nCount; i++) + { + SwTableAutoFormat const& rFormat = (*m_xTableTable)[i]; + m_xLbFormat->append_text(rFormat.GetName()); + if (pSelFormat && rFormat.GetName() == pSelFormat->GetName()) + m_nIndex = i; + } + + m_xLbFormat->select(255 != m_nIndex ? (m_nDfltStylePos + m_nIndex) : 0); + SelFormatHdl(*m_xLbFormat); +} + +void SwConvertTableDlg::UpdateChecks(const SwTableAutoFormat& rFormat, bool bEnable) +{ + m_xBtnNumFormat->set_sensitive(bEnable); + m_xBtnNumFormat->set_active(rFormat.IsValueFormat()); + + m_xBtnBorder->set_sensitive(bEnable); + m_xBtnBorder->set_active(rFormat.IsFrame()); + + m_xBtnFont->set_sensitive(bEnable); + m_xBtnFont->set_active(rFormat.IsFont()); + + m_xBtnPattern->set_sensitive(bEnable); + m_xBtnPattern->set_active(rFormat.IsBackground()); + + m_xBtnAlignment->set_sensitive(bEnable); + m_xBtnAlignment->set_active(rFormat.IsJustify()); +} + +std::unique_ptr<SwTableAutoFormat> SwConvertTableDlg::FillAutoFormatOfIndex() const +{ + if (255 != m_nIndex) + { + return std::make_unique<SwTableAutoFormat>((*m_xTableTable)[m_nIndex]); + } + + return nullptr; } -IMPL_LINK_NOARG(SwConvertTableDlg, AutoFormatHdl, weld::Button&, void) +IMPL_LINK(SwConvertTableDlg, CheckHdl, weld::Toggleable&, rBtn, void) { - SwAbstractDialogFactory& rFact = swui::GetFactory(); + if (m_nIndex == 255) + return; + + SwTableAutoFormat& rData = (*m_xTableTable)[m_nIndex]; + bool bCheck = rBtn.get_active(), bDataChgd = true; + + if (&rBtn == m_xBtnNumFormat.get()) + rData.SetValueFormat(bCheck); + else if (&rBtn == m_xBtnBorder.get()) + rData.SetFrame(bCheck); + else if (&rBtn == m_xBtnFont.get()) + rData.SetFont(bCheck); + else if (&rBtn == m_xBtnPattern.get()) + rData.SetBackground(bCheck); + else if (&rBtn == m_xBtnAlignment.get()) + rData.SetJustify(bCheck); + else + bDataChgd = false; - VclPtr<AbstractSwAutoFormatDlg> pDlg( - rFact.CreateSwAutoFormatDlg(m_xDialog.get(), m_pShell, false, mxTAutoFormat.get())); - pDlg->StartExecuteAsync([this, pDlg](sal_Int32 nResult) -> void { - if (nResult == RET_OK) + if (bDataChgd) + { + if (!m_bCoreDataChanged) { - pDlg->Apply(); - mxTAutoFormat = pDlg->FillAutoFormatOfIndex(); + m_bCoreDataChanged = true; } - pDlg->disposeOnce(); - }); + + m_aWndPreview.NotifyChange(rData); + Apply(); + mxTAutoFormat = FillAutoFormatOfIndex(); + } +} + +IMPL_LINK_NOARG(SwConvertTableDlg, SelFormatHdl, weld::TreeView&, void) +{ + sal_uInt8 nOldIdx = m_nIndex; + int nSelPos = m_xLbFormat->get_selected_index(); + if (nSelPos >= m_nDfltStylePos) + { + m_nIndex = nSelPos - m_nDfltStylePos; + m_aWndPreview.NotifyChange((*m_xTableTable)[m_nIndex]); + UpdateChecks((*m_xTableTable)[m_nIndex], true); + Apply(); + mxTAutoFormat = FillAutoFormatOfIndex(); + } + else + { + m_nIndex = 255; + + SwTableAutoFormat aTmp(SwViewShell::GetShellRes()->aStrNone); + aTmp.SetFont(false); + aTmp.SetJustify(false); + aTmp.SetFrame(false); + aTmp.SetBackground(false); + aTmp.SetValueFormat(false); + aTmp.SetWidthHeight(false); + + if (nOldIdx != m_nIndex) + m_aWndPreview.NotifyChange(aTmp); + UpdateChecks(aTmp, false); + } +} + +void SwConvertTableDlg::Apply() +{ + if (m_bSetAutoFormat) + m_pShell->SetTableStyle((*m_xTableTable)[m_nIndex]); } IMPL_LINK(SwConvertTableDlg, BtnHdl, weld::Toggleable&, rButton, void) diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index bc7057d75d4f..b2a152976675 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -25,8 +25,8 @@ #include <shellres.hxx> #include <tautofmt.hxx> -namespace { - +namespace +{ class SwStringInputDlg : public SfxDialogController { private: @@ -34,10 +34,9 @@ private: std::unique_ptr<weld::Entry> m_xEdInput; // Edit obtains the focus. public: - SwStringInputDlg(weld::Window* pParent, const OUString& rTitle, - const OUString& rEditTitle, const OUString& rDefault) - : SfxDialogController(pParent, "modules/swriter/ui/stringinput.ui", - "StringInputDialog") + SwStringInputDlg(weld::Window* pParent, const OUString& rTitle, const OUString& rEditTitle, + const OUString& rDefault) + : SfxDialogController(pParent, "modules/swriter/ui/stringinput.ui", "StringInputDialog") , m_xLabel(m_xBuilder->weld_label("name")) , m_xEdInput(m_xBuilder->weld_entry("edit")) { @@ -47,19 +46,14 @@ public: m_xEdInput->select_region(0, -1); } - OUString GetInputString() const - { - return m_xEdInput->get_text(); - } + OUString GetInputString() const { return m_xEdInput->get_text(); } }; - } // AutoFormat-Dialogue: -SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pWrtShell, - bool bAutoFormat, const SwTableAutoFormat* pSelFormat) - : SfxDialogController(pParent, "modules/swriter/ui/autoformattable.ui", - "AutoFormatTableDialog") +SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pWrtShell, bool bAutoFormat, + const SwTableAutoFormat* pSelFormat) + : SfxDialogController(pParent, "modules/swriter/ui/autoformattable.ui", "AutoFormatTableDialog") , m_aStrTitle(SwResId(STR_ADD_AUTOFORMAT_TITLE)) , m_aStrLabel(SwResId(STR_ADD_AUTOFORMAT_LABEL)) , m_aStrClose(SwResId(STR_BTN_AUTOFORMAT_CLOSE)) @@ -109,7 +103,7 @@ SwAutoFormatDlg::~SwAutoFormatDlg() m_xTableTable.reset(); } -void SwAutoFormatDlg::Init( const SwTableAutoFormat* pSelFormat ) +void SwAutoFormatDlg::Init(const SwTableAutoFormat* pSelFormat) { Link<weld::Toggleable&, void> aLk(LINK(this, SwAutoFormatDlg, CheckHdl)); m_xBtnBorder->connect_toggled(aLk); @@ -126,7 +120,7 @@ void SwAutoFormatDlg::Init( const SwTableAutoFormat* pSelFormat ) m_xBtnAdd->set_sensitive(m_bSetAutoFormat); m_nIndex = 0; - if( !m_bSetAutoFormat ) + if (!m_bSetAutoFormat) { // Then the list to be expanded by the entry "- none -". m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone); @@ -134,10 +128,9 @@ void SwAutoFormatDlg::Init( const SwTableAutoFormat* pSelFormat ) m_nIndex = 255; } - for (sal_uInt8 i = 0, nCount = static_cast<sal_uInt8>(m_xTableTable->size()); - i < nCount; i++) + for (sal_uInt8 i = 0, nCount = static_cast<sal_uInt8>(m_xTableTable->size()); i < nCount; i++) { - SwTableAutoFormat const& rFormat = (*m_xTableTable)[ i ]; + SwTableAutoFormat const& rFormat = (*m_xTableTable)[i]; m_xLbFormat->append_text(rFormat.GetName()); if (pSelFormat && rFormat.GetName() == pSelFormat->GetName()) m_nIndex = i; @@ -147,7 +140,7 @@ void SwAutoFormatDlg::Init( const SwTableAutoFormat* pSelFormat ) SelFormatHdl(*m_xLbFormat); } -void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnable ) +void SwAutoFormatDlg::UpdateChecks(const SwTableAutoFormat& rFormat, bool bEnable) { m_xBtnNumFormat->set_sensitive(bEnable); m_xBtnNumFormat->set_active(rFormat.IsValueFormat()); @@ -167,9 +160,9 @@ void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnab std::unique_ptr<SwTableAutoFormat> SwAutoFormatDlg::FillAutoFormatOfIndex() const { - if( 255 != m_nIndex ) + if (255 != m_nIndex) { - return std::make_unique<SwTableAutoFormat>( (*m_xTableTable)[ m_nIndex ] ); + return std::make_unique<SwTableAutoFormat>((*m_xTableTable)[m_nIndex]); } return nullptr; @@ -181,25 +174,25 @@ IMPL_LINK(SwAutoFormatDlg, CheckHdl, weld::Toggleable&, rBtn, void) if (m_nIndex == 255) return; - SwTableAutoFormat& rData = (*m_xTableTable)[m_nIndex]; + SwTableAutoFormat& rData = (*m_xTableTable)[m_nIndex]; bool bCheck = rBtn.get_active(), bDataChgd = true; if (&rBtn == m_xBtnNumFormat.get()) - rData.SetValueFormat( bCheck ); + rData.SetValueFormat(bCheck); else if (&rBtn == m_xBtnBorder.get()) - rData.SetFrame( bCheck ); + rData.SetFrame(bCheck); else if (&rBtn == m_xBtnFont.get()) - rData.SetFont( bCheck ); + rData.SetFont(bCheck); else if (&rBtn == m_xBtnPattern.get()) - rData.SetBackground( bCheck ); + rData.SetBackground(bCheck); else if (&rBtn == m_xBtnAlignment.get()) - rData.SetJustify( bCheck ); + rData.SetJustify(bCheck); else bDataChgd = false; - if( bDataChgd ) + if (bDataChgd) { - if( !m_bCoreDataChanged ) + if (!m_bCoreDataChanged) { m_xBtnCancel->set_label(m_aStrClose); m_bCoreDataChanged = true; @@ -212,31 +205,30 @@ IMPL_LINK(SwAutoFormatDlg, CheckHdl, weld::Toggleable&, rBtn, void) IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, weld::Button&, void) { bool bOk = false, bFormatInserted = false; - while( !bOk ) + while (!bOk) { SwStringInputDlg aDlg(m_xDialog.get(), m_aStrTitle, m_aStrLabel, OUString()); if (RET_OK == aDlg.run()) { const OUString aFormatName(aDlg.GetInputString()); - if ( !aFormatName.isEmpty() ) + if (!aFormatName.isEmpty()) { size_t n; - for( n = 0; n < m_xTableTable->size(); ++n ) - if( (*m_xTableTable)[n].GetName() == aFormatName ) + for (n = 0; n < m_xTableTable->size(); ++n) + if ((*m_xTableTable)[n].GetName() == aFormatName) break; - if( n >= m_xTableTable->size() ) + if (n >= m_xTableTable->size()) { // Format with the name does not already exist, so take up. - std::unique_ptr<SwTableAutoFormat> pNewData( - new SwTableAutoFormat(aFormatName)); - bool bGetOk = m_pShell->GetTableAutoFormat( *pNewData ); + std::unique_ptr<SwTableAutoFormat> pNewData(new SwTableAutoFormat(aFormatName)); + bool bGetOk = m_pShell->GetTableAutoFormat(*pNewData); SAL_WARN_IF(!bGetOk, "sw.ui", "GetTableAutoFormat failed for: " << aFormatName); // Insert sorted!! - for( n = 1; n < m_xTableTable->size(); ++n ) - if( (*m_xTableTable)[ n ].GetName() > aFormatName ) + for (n = 1; n < m_xTableTable->size(); ++n) + if ((*m_xTableTable)[n].GetName() > aFormatName) break; m_xTableTable->InsertAutoFormat(n, std::move(pNewData)); @@ -244,7 +236,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, weld::Button&, void) m_xLbFormat->select(m_nDfltStylePos + n); bFormatInserted = true; m_xBtnAdd->set_sensitive(false); - if ( !m_bCoreDataChanged ) + if (!m_bCoreDataChanged) { m_xBtnCancel->set_label(m_aStrClose); m_bCoreDataChanged = true; @@ -255,9 +247,11 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, weld::Button&, void) } } - if( !bFormatInserted ) + if (!bFormatInserted) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, m_aStrInvalidFormat)); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog( + m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, + m_aStrInvalidFormat)); bOk = RET_CANCEL == xBox->run(); } } @@ -268,11 +262,10 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl, weld::Button&, void) IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, weld::Button&, void) { - OUString aMessage = m_aStrDelMsg + "\n\n" + - m_xLbFormat->get_selected_text() + "\n"; + OUString aMessage = m_aStrDelMsg + "\n\n" + m_xLbFormat->get_selected_text() + "\n"; - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Question, - VclButtonsType::OkCancel, m_aStrDelTitle)); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog( + m_xDialog.get(), VclMessageType::Question, VclButtonsType::OkCancel, m_aStrDelTitle)); xBox->set_secondary_text(aMessage); if (xBox->run() == RET_OK) @@ -285,13 +278,13 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, weld::Button&, void) m_xTableTable->EraseAutoFormat(nIndex); m_nIndex = nIndex - 1; - if( !m_nIndex ) + if (!m_nIndex) { m_xBtnRemove->set_sensitive(false); m_xBtnRename->set_sensitive(false); } - if( !m_bCoreDataChanged ) + if (!m_bCoreDataChanged) { m_xBtnCancel->set_label(m_aStrClose); m_bCoreDataChanged = true; @@ -304,44 +297,44 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl, weld::Button&, void) IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl, weld::Button&, void) { bool bOk = false; - while( !bOk ) + while (!bOk) { - SwStringInputDlg aDlg(m_xDialog.get(), m_aStrRenameTitle, m_aStrLabel, m_xLbFormat->get_selected_text()); + SwStringInputDlg aDlg(m_xDialog.get(), m_aStrRenameTitle, m_aStrLabel, + m_xLbFormat->get_selected_text()); if (aDlg.run() == RET_OK) { bool bFormatRenamed = false; const OUString aFormatName(aDlg.GetInputString()); - if ( !aFormatName.isEmpty() ) + if (!aFormatName.isEmpty()) { size_t n; - for( n = 0; n < m_xTableTable->size(); ++n ) + for (n = 0; n < m_xTableTable->size(); ++n) if ((*m_xTableTable)[n].GetName() == aFormatName) break; - if( n >= m_xTableTable->size() ) + if (n >= m_xTableTable->size()) { sal_uInt8 nIndex = m_nIndex; // no format with this name exists, so rename it m_xLbFormat->remove(m_nDfltStylePos + nIndex); - std::unique_ptr<SwTableAutoFormat> p( - m_xTableTable->ReleaseAutoFormat(nIndex)); + std::unique_ptr<SwTableAutoFormat> p(m_xTableTable->ReleaseAutoFormat(nIndex)); - p->SetName( aFormatName ); + p->SetName(aFormatName); // keep all arrays sorted! - for( n = 1; n < m_xTableTable->size(); ++n ) + for (n = 1; n < m_xTableTable->size(); ++n) if ((*m_xTableTable)[n].GetName() > aFormatName) { break; } - m_xTableTable->InsertAutoFormat( n, std::move(p) ); + m_xTableTable->InsertAutoFormat(n, std::move(p)); m_xLbFormat->insert_text(m_nDfltStylePos + n, aFormatName); m_xLbFormat->select(m_nDfltStylePos + n); - if ( !m_bCoreDataChanged ) + if (!m_bCoreDataChanged) { m_xBtnCancel->set_label(m_aStrClose); m_bCoreDataChanged = true; @@ -353,9 +346,11 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl, weld::Button&, void) } } - if( !bFormatRenamed ) + if (!bFormatRenamed) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, m_aStrInvalidFormat)); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog( + m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, + m_aStrInvalidFormat)); bOk = RET_CANCEL == xBox->run(); } } @@ -374,23 +369,23 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, weld::TreeView&, void) m_nIndex = nSelPos - m_nDfltStylePos; m_aWndPreview.NotifyChange((*m_xTableTable)[m_nIndex]); bBtnEnable = 0 != m_nIndex; - UpdateChecks( (*m_xTableTable)[m_nIndex], true ); + UpdateChecks((*m_xTableTable)[m_nIndex], true); } else { m_nIndex = 255; - SwTableAutoFormat aTmp( SwViewShell::GetShellRes()->aStrNone ); - aTmp.SetFont( false ); - aTmp.SetJustify( false ); - aTmp.SetFrame( false ); - aTmp.SetBackground( false ); - aTmp.SetValueFormat( false ); - aTmp.SetWidthHeight( false ); + SwTableAutoFormat aTmp(SwViewShell::GetShellRes()->aStrNone); + aTmp.SetFont(false); + aTmp.SetJustify(false); + aTmp.SetFrame(false); + aTmp.SetBackground(false); + aTmp.SetValueFormat(false); + aTmp.SetWidthHeight(false); if (nOldIdx != m_nIndex) m_aWndPreview.NotifyChange(aTmp); - UpdateChecks( aTmp, false ); + UpdateChecks(aTmp, false); } m_xBtnRemove->set_sensitive(bBtnEnable); diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx index c780bd2d2472..053702f3abc3 100644 --- a/sw/source/uibase/inc/convert.hxx +++ b/sw/source/uibase/inc/convert.hxx @@ -19,7 +19,14 @@ #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CONVERT_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_CONVERT_HXX +#include <tools/link.hxx> #include <sfx2/basedlgs.hxx> +#include <sal/types.h> +#include <rtl/ustring.hxx> +#include <vcl/weld.hxx> + +#include "wrtsh.hxx" +#include "autoformatpreview.hxx" #include <tblafmt.hxx> class VclContainer; @@ -30,6 +37,19 @@ struct SwInsertTableOptions; class SwConvertTableDlg final : public SfxDialogController { + OUString m_aStrTitle; + OUString m_aStrLabel; + OUString m_aStrClose; + OUString m_aStrDelTitle; + OUString m_aStrDelMsg; + OUString m_aStrRenameTitle; + OUString m_aStrInvalidFormat; + sal_uInt8 m_nIndex; + sal_uInt8 m_nDfltStylePos; + bool m_bCoreDataChanged : 1; + bool m_bSetAutoFormat : 1; + + std::unique_ptr<SwTableAutoFormatTable> m_xTableTable; std::unique_ptr<weld::RadioButton> m_xTabBtn; std::unique_ptr<weld::RadioButton> m_xSemiBtn; std::unique_ptr<weld::RadioButton> m_xParaBtn; @@ -46,21 +66,39 @@ class SwConvertTableDlg final : public SfxDialogController std::unique_ptr<weld::SpinButton> m_xRepeatHeaderNF; std::unique_ptr<weld::CheckButton> m_xDontSplitCB; - std::unique_ptr<weld::Button> m_xAutoFormatBtn; std::unique_ptr<SwTableAutoFormat> mxTAutoFormat; + + std::unique_ptr<weld::TreeView> m_xLbFormat; + std::unique_ptr<weld::CheckButton> m_xBtnNumFormat; + std::unique_ptr<weld::CheckButton> m_xBtnBorder; + std::unique_ptr<weld::CheckButton> m_xBtnFont; + std::unique_ptr<weld::CheckButton> m_xBtnPattern; + std::unique_ptr<weld::CheckButton> m_xBtnAlignment; + AutoFormatPreview m_aWndPreview; + std::unique_ptr<weld::CustomWeld> m_xWndPreview; SwWrtShell* m_pShell; - DECL_LINK(AutoFormatHdl, weld::Button&, void); + void Init(); + void UpdateChecks(const SwTableAutoFormat&, bool bEnableBtn); + DECL_LINK(BtnHdl, weld::Toggleable&, void); DECL_LINK(CheckBoxHdl, weld::Toggleable&, void); DECL_LINK(RepeatHeaderCheckBoxHdl, weld::Toggleable&, void); + DECL_LINK(CheckHdl, weld::Toggleable&, void); + DECL_LINK(SelFormatHdl, weld::TreeView&, void); public: SwConvertTableDlg(SwView& rView, bool bToTable); void GetValues(sal_Unicode& rDelim, SwInsertTableOptions& rInsTableOpts, SwTableAutoFormat const*& prTAFormat); + + std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const; + + void Apply(); + + virtual ~SwConvertTableDlg() override; }; #endif diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx index 8cddab7fcca0..b426dc71b443 100644 --- a/sw/source/uibase/inc/tautofmt.hxx +++ b/sw/source/uibase/inc/tautofmt.hxx @@ -35,19 +35,19 @@ class SwWrtShell; class SwAutoFormatDlg final : public SfxDialogController { - OUString m_aStrTitle; - OUString m_aStrLabel; - OUString m_aStrClose; - OUString m_aStrDelTitle; - OUString m_aStrDelMsg; - OUString m_aStrRenameTitle; - OUString m_aStrInvalidFormat; + OUString m_aStrTitle; + OUString m_aStrLabel; + OUString m_aStrClose; + OUString m_aStrDelTitle; + OUString m_aStrDelMsg; + OUString m_aStrRenameTitle; + OUString m_aStrInvalidFormat; - SwWrtShell* m_pShell; - sal_uInt8 m_nIndex; - sal_uInt8 m_nDfltStylePos; - bool m_bCoreDataChanged : 1; - bool m_bSetAutoFormat : 1; + SwWrtShell* m_pShell; + sal_uInt8 m_nIndex; + sal_uInt8 m_nDfltStylePos; + bool m_bCoreDataChanged : 1; + bool m_bSetAutoFormat : 1; AutoFormatPreview m_aWndPreview; std::unique_ptr<SwTableAutoFormatTable> m_xTableTable; @@ -64,8 +64,8 @@ class SwAutoFormatDlg final : public SfxDialogController std::unique_ptr<weld::Button> m_xBtnRename; std::unique_ptr<weld::CustomWeld> m_xWndPreview; - void Init( const SwTableAutoFormat* pSelFormat ); - void UpdateChecks( const SwTableAutoFormat&, bool bEnableBtn ); + void Init(const SwTableAutoFormat* pSelFormat); + void UpdateChecks(const SwTableAutoFormat&, bool bEnableBtn); DECL_LINK(CheckHdl, weld::Toggleable&, void); DECL_LINK(AddHdl, weld::Button&, void); @@ -74,8 +74,8 @@ class SwAutoFormatDlg final : public SfxDialogController DECL_LINK(SelFormatHdl, weld::TreeView&, void); public: - SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pShell, - bool bSetAutoFormat, const SwTableAutoFormat* pSelFormat); + SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pShell, bool bSetAutoFormat, + const SwTableAutoFormat* pSelFormat); std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const; diff --git a/sw/uiconfig/swriter/ui/converttexttable.ui b/sw/uiconfig/swriter/ui/converttexttable.ui index 6fdb17083007..9848d8140a24 100644 --- a/sw/uiconfig/swriter/ui/converttexttable.ui +++ b/sw/uiconfig/swriter/ui/converttexttable.ui @@ -1,436 +1,661 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.36.0 --> <interface domain="sw"> - <requires lib="gtk+" version="3.20"/> - <object class="GtkAdjustment" id="adjustment1"> - <property name="lower">1</property> - <property name="upper">1000</property> - <property name="value">1</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkDialog" id="ConvertTextTableDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> - <property name="title" translatable="yes" context="converttexttable|ConvertTextTableDialog">Convert Table to Text</property> - <property name="modal">True</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="ok"> - <property name="label" translatable="yes" context="stock">_OK</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="use-underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="cancel"> - <property name="label" translatable="yes" context="stock">_Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use-underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="help"> - <property name="label" translatable="yes" context="stock">_Help</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use-underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - <property name="secondary">True</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkBox" id="box1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> - <child> - <object class="GtkFrame" id="frame1"> - <property name="visible">True</property> + <requires lib="gtk+" version="3.20"/> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">1000</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkTreeStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> + <object class="GtkDialog" id="ConvertTextTableDialog"> <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid" id="grid1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="valign">start</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <property name="margin-start">12</property> - <property name="margin-top">6</property> - <child> - <object class="GtkRadioButton" id="tabs"> - <property name="label" translatable="yes" context="converttexttable|tabs">Tabs</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="tabs-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|tabs">Converts the text to a table using tabs as column markers.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="semicolons"> - <property name="label" translatable="yes" context="converttexttable|semicolons">Semicolons</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <property name="group">tabs</property> - <child internal-child="accessible"> - <object class="AtkObject" id="semicolons-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|semicolons">Converts the text to a table using semi-colons (;) as column markers.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">2</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="paragraph"> - <property name="label" translatable="yes" context="converttexttable|paragraph">Paragraph</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <property name="group">tabs</property> - <child internal-child="accessible"> - <object class="AtkObject" id="paragraph-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|paragraph">Converts the text to a table using paragraphs as column markers.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="other"> - <property name="label" translatable="yes" context="converttexttable|other">Other:</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <property name="group">tabs</property> - <accessibility> - <relation type="label-for" target="othered"/> - </accessibility> - <child internal-child="accessible"> - <object class="AtkObject" id="other-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|other">Converts the text to a table using the character that you type in the box as a column marker.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="othered"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="max_length">1</property> - <property name="activates_default">True</property> - <property name="width_chars">1</property> - <property name="max_width_chars">1</property> - <property name="text" translatable="yes" context="converttexttable|othered">,</property> - <accessibility> - <relation type="labelled-by" target="other"/> - </accessibility> - <property name="truncate-multiline">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="othered-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="converttexttable|othered-atkobject">Symbol</property> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|othered">Type the character that you want to use as a column marker.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="keepcolumn"> - <property name="label" translatable="yes" context="converttexttable|keepcolumn">Equal width for all columns</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="keepcolumn-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|keepcolumn">Creates columns of equal width, regardless of the position of the column marker.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">3</property> - </packing> - </child> - </object> + <property name="border_width">6</property> + <property name="title" translatable="yes" context="converttexttable|ConvertTextTableDialog">Convert Table to Text</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label" translatable="yes" context="stock">_OK</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label" translatable="yes" context="stock">_Cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label" translatable="yes" context="stock">_Help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use-underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <property name="column-homogeneous">True</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <property name="column-homogeneous">True</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <child> + <object class="GtkRadioButton" id="tabs"> + <property name="label" translatable="yes" context="converttexttable|tabs">Tabs</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="tabs-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|tabs">Converts the text to a table using tabs as column markers.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="semicolons"> + <property name="label" translatable="yes" context="converttexttable|semicolons">Semicolons</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">tabs</property> + <child internal-child="accessible"> + <object class="AtkObject" id="semicolons-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|semicolons">Converts the text to a table using semi-colons (;) as column markers.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="paragraph"> + <property name="label" translatable="yes" context="converttexttable|paragraph">Paragraph</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">tabs</property> + <child internal-child="accessible"> + <object class="AtkObject" id="paragraph-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|paragraph">Converts the text to a table using paragraphs as column markers.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="other"> + <property name="label" translatable="yes" context="converttexttable|other">Other:</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">tabs</property> + <accessibility> + <relation type="label-for" target="othered"/> + </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="other-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|other">Converts the text to a table using the character that you type in the box as a column marker.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="othered"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="max_length">1</property> + <property name="activates_default">True</property> + <property name="width_chars">1</property> + <property name="max_width_chars">1</property> + <property name="text" translatable="yes" context="converttexttable|othered">,</property> + <accessibility> + <relation type="labelled-by" target="other"/> + </accessibility> + <property name="truncate-multiline">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="othered-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="converttexttable|othered-atkobject">Symbol</property> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|othered">Type the character that you want to use as a column marker.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="keepcolumn"> + <property name="label" translatable="yes" context="converttexttable|keepcolumn">Equal width for all columns</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="keepcolumn-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|keepcolumn">Creates columns of equal width, regardless of the position of the column marker.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">3</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label1">Separate Text At</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="options"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <child> + <object class="GtkCheckButton" id="headingcb"> + <property name="label" translatable="yes" context="converttexttable|headingcb">Heading</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="headingcb-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|headingcb">Formats the first row of the new table as a heading.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="repeatheading"> + <property name="label" translatable="yes" context="converttexttable|repeatheading">Repeat heading</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="margin-start">12</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="repeatheading-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|repeatheading">Repeats the table header on each page that the table spans.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="dontsplitcb"> + <property name="label" translatable="yes" context="converttexttable|dontsplitcb">Don't split table</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="dontsplitcb-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|dontsplitcb">Does not divide the table across pages.</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <!-- n-columns=1 n-rows=1 --> + <object class="GtkGrid" id="repeatrows"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="margin-start">24</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label3">The first </property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">repeatheadersb</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label4">rows</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="repeatheadersb"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="activates_default">True</property> + <property name="truncate-multiline">True</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label2">Options</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + </child> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="format"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <!-- n-columns=2 n-rows=1 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <property name="column-spacing">12</property> + <child> + <!-- n-columns=2 n-rows=1 --> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <property name="column-homogeneous">True</property> + <child> + <object class="GtkDrawingArea" id="preview"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow-type">in</property> + <child> + <object class="GtkTreeView" id="formatlb"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore1</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn1"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label5">Format</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="formatting"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <!-- n-columns=3 n-rows=2 --> + <object class="GtkGrid" id="grid4"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> + <child> + <object class="GtkCheckButton" id="numformatcb"> + <property name="label" translatable="yes" context="converttexttable|numformatcb">Number format</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="bordercb"> + <property name="label" translatable="yes" context="converttexttable|bordercb">Borders</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="fontcb"> + <property name="label" translatable="yes" context="converttexttable|fontcb">Font</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="patterncb"> + <property name="label" translatable="yes" context="converttexttable|patterncb">Pattern</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="alignmentcb"> + <property name="label" translatable="yes" context="converttexttable|alignmentcb">Alignment</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="use-underline">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="left-attach">4</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="converttexttable|label6">Formatting</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + </object> </child> - <child type="label"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="converttexttable|label1">Separate Text At</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> + <action-widgets> + <action-widget response="-5">ok</action-widget> + <action-widget response="-6">cancel</action-widget> + <action-widget response="-11">help</action-widget> + </action-widgets> + <child type="titlebar"> + <placeholder/> </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="options"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid" id="grid3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <property name="margin-start">12</property> - <property name="margin-top">6</property> - <child> - <object class="GtkCheckButton" id="headingcb"> - <property name="label" translatable="yes" context="converttexttable|headingcb">Heading</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="headingcb-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|headingcb">Formats the first row of the new table as a heading.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="repeatheading"> - <property name="label" translatable="yes" context="converttexttable|repeatheading">Repeat heading</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="margin-start">12</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="repeatheading-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|repeatheading">Repeats the table header on each page that the table spans.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="dontsplitcb"> - <property name="label" translatable="yes" context="converttexttable|dontsplitcb">Don't split table</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="dontsplitcb-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|dontsplitcb">Does not divide the table across pages.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid" id="repeatrows"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="margin-start">24</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="converttexttable|label3">The first </property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">repeatheadersb</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="converttexttable|label4">rows</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="repeatheadersb"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="activates_default">True</property> - <property name="truncate-multiline">True</property> - <property name="adjustment">adjustment1</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="autofmt"> - <property name="label" translatable="yes" context="converttexttable|autofmt">AutoFormat...</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="autofmt-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|autofmt">Opens the AutoFormat dialog, where you can select a predefined layout for table.</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - </packing> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="converttexttable|label2">Options</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> + <child internal-child="accessible"> + <object class="AtkObject" id="ConvertTextTableDialog-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|ConvertTextTableDialog">Converts the selected text into a table, or the selected table into text.</property> + </object> </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="-5">ok</action-widget> - <action-widget response="-6">cancel</action-widget> - <action-widget response="-11">help</action-widget> - </action-widgets> - <child type="titlebar"> - <placeholder/> - </child> - <child internal-child="accessible"> - <object class="AtkObject" id="ConvertTextTableDialog-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="converttexttable|extended_tip|ConvertTextTableDialog">Converts the selected text into a table, or the selected table into text.</property> - </object> - </child> - </object> -</interface> + </object> +</interface>
\ No newline at end of file |