[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-5' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 24 19:06:01 UTC 2020


 sw/source/ui/index/cnttab.cxx       |    2 +-
 sw/source/uibase/inc/unotools.hxx   |    5 +++--
 sw/source/uibase/utlui/unotools.cxx |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 398e97bf95b27ea21885cf55111ef0b0742b1be3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 23 20:04:21 2020 +0100
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Wed Jun 24 21:05:31 2020 +0200

    tdf#134243 only do the toc-terms localization when showing toc preview
    
    and not when previewing another document, which sidesteps the
    infinite loop in this example
    
    Change-Id: Ideb41029f4c98a50555cd35227867d9fdd5ae5a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96889
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    (cherry picked from commit ba7c6f5a8ed01320bf15796df2ab196b1b485b48)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97006
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 0238c3138638..520720b30dbd 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -444,7 +444,7 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, weld::ToggleButton&, void)
             else
             {
                 Link<SwOneExampleFrame&,void> aLink(LINK(this, SwMultiTOXTabDialog, CreateExample_Hdl));
-                m_xExampleFrame.reset(new SwOneExampleFrame(EX_SHOW_ONLINE_LAYOUT, &aLink, &sTemplate));
+                m_xExampleFrame.reset(new SwOneExampleFrame(EX_SHOW_ONLINE_LAYOUT | EX_LOCALIZE_TOC_STRINGS, &aLink, &sTemplate));
                 m_xExampleFrameWin.reset(new weld::CustomWeld(*m_xBuilder, "example", *m_xExampleFrame));
             }
             m_xShowExampleCB->set_visible(m_xExampleFrame != nullptr);
diff --git a/sw/source/uibase/inc/unotools.hxx b/sw/source/uibase/inc/unotools.hxx
index 830e39085a52..0890536dab16 100644
--- a/sw/source/uibase/inc/unotools.hxx
+++ b/sw/source/uibase/inc/unotools.hxx
@@ -26,12 +26,13 @@
 #include <com/sun/star/text/XTextCursor.hpp>
 #include <swdllapi.h>
 
-#define EX_SHOW_ONLINE_LAYOUT   0x001
-
+#define EX_SHOW_ONLINE_LAYOUT   0x01
 // hard zoom value
 #define EX_SHOW_BUSINESS_CARDS  0x02
 //don't modify page size
 #define EX_SHOW_DEFAULT_PAGE    0x04
+//replace sample toc strings in the template to localized versions
+#define EX_LOCALIZE_TOC_STRINGS 0x08
 
 class SwView;
 
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 8fa6df88650b..4eb0bc361495 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -304,7 +304,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
         auto pCursor = comphelper::getUnoTunnelImplementation<OTextCursorHelper>(m_xCursor);
 
         SwDoc *pDoc = pCursor ? pCursor->GetDoc() : nullptr;
-        if (pDoc)
+        if (pDoc && (m_nStyleFlags & EX_LOCALIZE_TOC_STRINGS))
         {
             SwEditShell* pSh = pDoc->GetEditShell();
 


More information about the Libreoffice-commits mailing list