[Libreoffice-commits] core.git: Branch 'feature/cib_contract57c' - 8 commits - external/openldap javaunohelper/com odk/build-examples_common.mk odk/examples solenv/gbuild sw/source

Luke Deller (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 23 16:14:25 UTC 2021


 external/openldap/ExternalProject_openldap.mk                      |    1 
 javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java  |   48 ++++----
 odk/build-examples_common.mk                                       |    2 
 odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Makefile |    3 
 solenv/gbuild/platform/com_GCC_defs.mk                             |    4 
 sw/source/core/inc/layact.hxx                                      |   24 ++--
 sw/source/core/layout/layact.cxx                                   |   59 +++++-----
 sw/source/core/view/viewsh.cxx                                     |    1 
 8 files changed, 77 insertions(+), 65 deletions(-)

New commits:
commit 5f6975bb5d83081ba0da5021b11434666ee49d4a
Author:     Luke Deller <luke at deller.id.au>
AuthorDate: Fri Apr 9 09:08:37 2021 +1000
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jun 23 17:24:52 2021 +0200

    tdf#141556 Fix 100% CPU usage in Writer idle loop
    
    Do not interrupt the idle layout processing unnecessarily, because if it
    is continually interrupted before making enough progress then it will
    keep resuming at the same page, never finishing, constantly using CPU.
    
    This is achieved with two changes:
    
     - Revert "tdf#123583 use TaskStopwatch for Writer Idle loop"
       (commit 383032c50a3e3354f04200ce984a47ab9d2c5c67) which
       introduced a stopwatch timer to interrupt idle processing every 50ms.
       This reversion restores the previous behaviour where idle processing
       is interrupted only when there is an input event.
    
     - Filter out TIMER events so that they do not interrupt the idle loop;
       this fixes both tdf#123583 and tdf#141556
    
    Conflicts:
            sw/source/core/inc/layact.hxx
            sw/source/core/layout/layact.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113825
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit 0fedac18214a6025401c4c426466a5166553e8ec)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114944
    (cherry picked from commit b33148071ae6256845352f8625e58b1ab95be41c)
    
    Change-Id: Ic989631e5f32199209d64b66b72059253fc0167a

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 7a843e60f0d1..f114273c0231 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -21,7 +21,7 @@
 
 #include <sal/config.h>
 
-#include <vcl/TaskStopwatch.hxx>
+#include <vcl/inputtypes.hxx>
 
 #include <ctime>
 
@@ -54,7 +54,6 @@ class SwLayAction
 {
     SwRootFrame  *m_pRoot;
     SwViewShellImp  *m_pImp; // here the action logs in and off
-    TaskStopwatch* m_pWatch;
 
     // For the sake of optimization, so that the tables stick a bit better to
     // the Cursor when hitting return/backspace in front of one.
@@ -73,6 +72,7 @@ class SwLayAction
     std::clock_t m_nStartTicks;      // The Action's starting time; if too much time passes the
                                 // WaitCursor can be enabled via CheckWaitCursor()
 
+    VclInputFlags m_nInputType;   // Which input should terminate processing
     sal_uInt16 m_nEndPage;        // StatBar control
     sal_uInt16 m_nCheckPageNum;   // CheckPageDesc() was delayed if != USHRT_MAX
                                 // check from this page onwards
@@ -82,8 +82,9 @@ class SwLayAction
     bool m_bCalcLayout;    // Complete reformatting?
     bool m_bAgain;         // For the automatically repeated Action if Pages are deleted
     bool m_bNextCycle;     // Reset on the first invalid Page
+    bool m_bInput;         // For terminating processing on input
+    bool m_bIdle;          // True if the LayAction was triggered by the Idler
     bool m_bReschedule;    // Call Reschedule depending on Progress?
-    bool m_bInterrupt;     // For termination the layouting
     bool m_bCheckPages;    // Run CheckPageDescs() or delay it
     bool m_bUpdateExpFields; // Is set if, after Formatting, we need to do another round for ExpField
     bool m_bBrowseActionStop; // Terminate Action early (as per bInput) and leave the rest to the Idler
@@ -116,26 +117,33 @@ class SwLayAction
 
     bool RemoveEmptyBrowserPages();
 
+    inline void CheckIdleEnd();
+
 public:
-    SwLayAction(SwRootFrame *pRt, SwViewShellImp *pImp, TaskStopwatch* pWatch = nullptr);
+    SwLayAction( SwRootFrame *pRt, SwViewShellImp *pImp );
     ~SwLayAction();
 
+    void SetIdle            ( bool bNew )   { m_bIdle = bNew; }
     void SetCheckPages      ( bool bNew )   { m_bCheckPages = bNew; }
     void SetBrowseActionStop( bool bNew )   { m_bBrowseActionStop = bNew; }
     void SetNextCycle       ( bool bNew )   { m_bNextCycle = bNew; }
 
     bool IsWaitAllowed()        const       { return m_bWaitAllowed; }
     bool IsNextCycle()          const       { return m_bNextCycle; }
+    bool IsInput()              const       { return m_bInput; }
     bool IsPaint()              const       { return m_bPaint; }
+    bool IsIdle()               const       { return m_bIdle;  }
     bool IsReschedule()         const       { return m_bReschedule;  }
-    bool IsIdle()               const       { return m_pWatch != nullptr; }
-    bool IsPaintExtraData()     const       { return m_bPaintExtraData; }
-    bool IsInterrupt();
+    bool IsPaintExtraData()     const       { return m_bPaintExtraData;}
+    bool IsInterrupt()          const       { return IsInput(); }
+
+    VclInputFlags GetInputType()    const { return m_nInputType; }
 
     // adjusting Action to the wanted behaviour
     void SetPaint       ( bool bNew )   { m_bPaint = bNew; }
     void SetComplete    ( bool bNew )   { m_bComplete = bNew; }
     void SetStatBar     ( bool bNew );
+    void SetInputType   ( VclInputFlags nNew ) { m_nInputType = nNew; }
     void SetCalcLayout  ( bool bNew )   { m_bCalcLayout = bNew; }
     void SetReschedule  ( bool bNew )   { m_bReschedule = bNew; }
     void SetWaitAllowed ( bool bNew )   { m_bWaitAllowed = bNew; }
@@ -172,7 +180,6 @@ public:
 
 class SwLayIdle
 {
-    TaskStopwatch m_aWatch;
     SwRootFrame *pRoot;
     SwViewShellImp  *pImp;           // The Idler registers and deregisters here
     SwContentNode *pContentNode;    // The current cursor position is saved here
@@ -184,7 +191,6 @@ class SwLayIdle
     void ShowIdle( Color eName );
 #endif
 
-    bool IsInterrupt();
     enum IdleJobType{ ONLINE_SPELLING, AUTOCOMPLETE_WORDS, WORD_COUNT, SMART_TAGS };
     bool DoIdleJob_( const SwContentFrame*, IdleJobType );
     bool DoIdleJob( IdleJobType, bool bVisAreaOnly );
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index f4c4b26941f1..f64ba3049cb1 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -82,6 +82,13 @@ void SwLayAction::CheckWaitCursor()
     }
 }
 
+// Time over already?
+inline void SwLayAction::CheckIdleEnd()
+{
+    if ( !IsInput() )
+        m_bInput = bool(GetInputType()) && Application::AnyInput( GetInputType() );
+}
+
 void SwLayAction::SetStatBar( bool bNew )
 {
     if ( bNew )
@@ -239,20 +246,20 @@ void SwLayAction::PaintContent( const SwContentFrame *pCnt,
     }
 }
 
-SwLayAction::SwLayAction(SwRootFrame *pRt, SwViewShellImp *pI, TaskStopwatch* pWatch)
-    : m_pRoot(pRt),
+SwLayAction::SwLayAction( SwRootFrame *pRt, SwViewShellImp *pI ) :
+    m_pRoot( pRt ),
     m_pImp( pI ),
-    m_pWatch(pWatch),
     m_pOptTab( nullptr ),
     m_pWait( nullptr ),
     m_nPreInvaPage( USHRT_MAX ),
     m_nStartTicks( std::clock() ),
+    m_nInputType( VclInputFlags::NONE ),
     m_nEndPage( USHRT_MAX ),
     m_nCheckPageNum( USHRT_MAX )
 {
     m_bPaintExtraData = ::IsExtraData( m_pImp->GetShell()->GetDoc() );
     m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
-    m_bInterrupt = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bReschedule =
+    m_bInput = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bIdle = m_bReschedule =
     m_bUpdateExpFields = m_bBrowseActionStop = m_bActionInProgress = false;
     // init new flag <mbFormatContentOnInterrupt>.
     mbFormatContentOnInterrupt = false;
@@ -267,18 +274,14 @@ SwLayAction::~SwLayAction()
     m_pImp->m_pLayAction = nullptr;      // unregister
 }
 
-bool SwLayAction::IsInterrupt()
-{
-    return m_bInterrupt || (m_pWatch && m_pWatch->exceededRuntime());
-}
-
 void SwLayAction::Reset()
 {
     m_pOptTab = nullptr;
     m_nStartTicks = std::clock();
+    m_nInputType = VclInputFlags::NONE;
     m_nEndPage = m_nPreInvaPage = m_nCheckPageNum = USHRT_MAX;
     m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
-    m_bInterrupt = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bReschedule =
+    m_bInput = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bIdle = m_bReschedule =
     m_bUpdateExpFields = m_bBrowseActionStop = false;
 }
 
@@ -439,7 +442,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
     IDocumentLayoutAccess& rLayoutAccess = m_pRoot->GetFormat()->getIDocumentLayoutAccess();
     bool bNoLoop = pPage && SwLayouter::StartLoopControl( m_pRoot->GetFormat()->GetDoc(), pPage );
     sal_uInt16 nPercentPageNum = 0;
-    while ((!IsInterrupt() && pPage) || (m_nCheckPageNum != USHRT_MAX))
+    while ( (pPage && !IsInterrupt()) || m_nCheckPageNum != USHRT_MAX )
     {
         if ( !pPage && m_nCheckPageNum != USHRT_MAX &&
              (!pPage || pPage->GetPhyPageNum() >= m_nCheckPageNum) )
@@ -562,7 +565,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                             pPage->InvalidateFlyLayout();
                             pPage->InvalidateFlyContent();
                             if ( IsBrowseActionStop() )
-                                m_bInterrupt = true;
+                                m_bInput = true;
                         }
                     }
                     if( bNoLoop )
@@ -580,8 +583,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                 pPage->ValidateFlyLayout();
                 pPage->ValidateFlyContent();
             }
-
-            if (!IsInterrupt())
+            if ( !IsInterrupt() )
             {
                 SetNextCycle( false );
 
@@ -622,8 +624,8 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                 if( bNoLoop )
                     rLayoutAccess.GetLayouter()->LoopControl( pPage );
             }
+            CheckIdleEnd();
         }
-
         if ( !pPage && !IsInterrupt() &&
              (m_pRoot->IsSuperfluous() || m_pRoot->IsAssertFlyPages()) )
         {
@@ -649,7 +651,6 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                 pPage = static_cast<SwPageFrame*>(pPage->GetNext());
         }
     }
-
     if ( IsInterrupt() && pPage )
     {
         // If we have input, we don't want to format content anymore, but
@@ -678,7 +679,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
             pPg = pPg ? static_cast<SwPageFrame*>(pPg->GetPrev()) : pPage;
 
         // set flag for interrupt content formatting
-        mbFormatContentOnInterrupt = IsInterrupt();
+        mbFormatContentOnInterrupt = IsInput();
         long nBottom = rVis.Bottom();
         // #i42586# - format current page, if idle action is active
         // This is an optimization for the case that the interrupt is created by
@@ -772,6 +773,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
 
 bool SwLayAction::TurboAction_( const SwContentFrame *pCnt )
 {
+
     const SwPageFrame *pPage = nullptr;
     if ( !pCnt->isFrameAreaDefinitionValid() || pCnt->IsCompletePaint() || pCnt->IsRetouche() )
     {
@@ -832,7 +834,10 @@ bool SwLayAction::TurboAction()
     if ( m_pRoot->GetTurbo() )
     {
         if ( !TurboAction_( m_pRoot->GetTurbo() ) )
+        {
+            CheckIdleEnd();
             bRet = false;
+        }
         m_pRoot->ResetTurbo();
     }
     else
@@ -1634,6 +1639,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage )
             // paragraph has been processed.
             if (!pTab || !bInValid)
             {
+                CheckIdleEnd();
                 // consider interrupt formatting.
                 if ( ( IsInterrupt() && !mbFormatContentOnInterrupt ) ||
                      ( !bBrowse && pPage->IsInvalidLayout() ) ||
@@ -1726,6 +1732,7 @@ bool SwLayAction::FormatContent( const SwPageFrame *pPage )
                 PaintContent( pContent, pPage, pContent->getFrameArea(), pContent->getFrameArea().Bottom());
             if ( IsIdle() )
             {
+                CheckIdleEnd();
                 // consider interrupt formatting.
                 if ( IsInterrupt() && !mbFormatContentOnInterrupt )
                     return false;
@@ -1821,6 +1828,7 @@ void SwLayAction::FormatFlyContent( const SwFlyFrame *pFly )
         // If there's input, we interrupt processing.
         if ( !pFly->IsFlyInContentFrame() )
         {
+            CheckIdleEnd();
             // consider interrupt formatting.
             if ( IsInterrupt() && !mbFormatContentOnInterrupt )
                 return;
@@ -1830,11 +1838,6 @@ void SwLayAction::FormatFlyContent( const SwFlyFrame *pFly )
     CheckWaitCursor();
 }
 
-bool SwLayIdle::IsInterrupt()
-{
-    return m_aWatch.exceededRuntime();
-}
-
 bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
 {
     OSL_ENSURE( pCnt->IsTextFrame(), "NoText neighbour of Text" );
@@ -1918,7 +1921,7 @@ bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
                 bPageValid = bPageValid && (SwTextNode::WrongState::TODO != pTextNode->GetWrongDirty());
                 if ( aRepaint.HasArea() )
                     pImp->GetShell()->InvalidateWindows( aRepaint );
-                if (IsInterrupt())
+                if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER)))
                     return true;
                 break;
             }
@@ -1926,7 +1929,7 @@ bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
                 const_cast<SwTextFrame*>(pTextFrame)->CollectAutoCmplWrds(*pTextNode, nPos);
                 // note: bPageValid remains true here even if the cursor
                 // position is skipped, so no PENDING state needed currently
-                if (IsInterrupt())
+                if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER)))
                     return true;
                 break;
             case WORD_COUNT :
@@ -1934,7 +1937,7 @@ bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
                 const sal_Int32 nEnd = pTextNode->GetText().getLength();
                 SwDocStat aStat;
                 pTextNode->CountWords( aStat, 0, nEnd );
-                if (IsInterrupt())
+                if ( Application::AnyInput() )
                     return true;
                 break;
             }
@@ -1949,7 +1952,7 @@ bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
                     // handle smarttag problems gracefully and provide diagnostics
                     SAL_WARN( "sw.core", "SMART_TAGS: " << e);
                 }
-                if (IsInterrupt())
+                if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER)))
                     return true;
                 break;
             }
@@ -2141,7 +2144,9 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp *pI ) :
 
         bool bInterrupt(false);
         {
-            SwLayAction aAction(pRoot, pImp, &m_aWatch);
+            SwLayAction aAction(pRoot, pImp);
+            aAction.SetInputType( VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER) );
+            aAction.SetIdle( true );
             aAction.SetWaitAllowed( false );
             aAction.Action(pImp->GetShell()->GetOut());
             bInterrupt = aAction.IsInterrupt();
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index b5f67116c311..640db966432e 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -277,6 +277,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
         aAction.SetComplete( false );
         if ( mnLockPaint )
             aAction.SetPaint( false );
+        aAction.SetInputType( VclInputFlags::KEYBOARD );
         aAction.Action(GetWin());
     }
 
commit 56c73213a27ee87ffd624f2f5a332bbf4572222d
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Oct 20 14:38:35 2018 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jun 23 17:24:52 2021 +0200

    Java 11 no longer synthesizes DocumentView$1.class
    
    ...so, for simplicity, just include whatever generated DocumentView$*.class by
    wildcard
    
    Change-Id: I779e2709c8ef2859d68233300302dd62dbe2455f
    Reviewed-on: https://gerrit.libreoffice.org/62073
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 21ba68ae7991ee0f6546d765dcad2c84cd05a375)

diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Makefile b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Makefile
index 42271086aef0..2048ade63d98 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Makefile
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Makefile
@@ -66,8 +66,7 @@ APP1_JAVAFILES  = \
 APP1_CLASSFILES = $(patsubst %.java,$(OUT_APP_CLASS)/%.class,$(APP1_JAVAFILES))
 APP1_CLASSNAMES = $(patsubst %.java,%.class,$(APP1_JAVAFILES)) \
 		CustomizeView$(QUOTE)$$ClickListener.class \
-		DocumentView$(QUOTE)$$1.class \
-		DocumentView$(QUOTE)$$Reactor.class
+		DocumentView$(QUOTE)$$*.class
 
 
 SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
commit c19e5d9dce3df35b61cd43a188336b1935199f97
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Mon May 3 12:48:14 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jun 23 17:24:51 2021 +0200

    odk: build examples with GCC with explicit -std=c++11
    
    GCC 11 defaults to -std=c++17, which doesn't support exception
    specifications any more.
    
    ddcc98fa50dd9d86a60dada4daa00f4d95ffe005 seems a bit large to backport.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115505
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    (cherry picked from commit dff559024d271a69186b608615f4a7095cbee2a4)
    
    Change-Id: I74a182435b268be8fd7a9ff0be9f404122108b51

diff --git a/odk/build-examples_common.mk b/odk/build-examples_common.mk
index 4d7d645ed40a..9f5231c42765 100644
--- a/odk/build-examples_common.mk
+++ b/odk/build-examples_common.mk
@@ -31,7 +31,7 @@ endif
 	$(foreach my_dir,$(2), \
 	    && (cd $(INSTDIR)/$(SDKDIRNAME)/examples/$(my_dir) \
 		&& printf 'yes\n' | LC_ALL=C make \
-			CC="$(CXX)" LINK="$(CXX)" LIB="$(CXX)" \
+			CC="$(CXX) $(if $(filter GCC,$(COM)),-std=c++11)" LINK="$(CXX)" LIB="$(CXX)" \
 		    $(if $(filter MACOSX,$(OS)), SHELL=$(ODK_BUILD_SHELL), )))) \
 	    >$(call gb_CustomTarget_get_workdir,$(1))/log 2>&1 \
 	|| (RET=$$$$? \
commit 8d58d9e8becaacdfe89a2bf3cf96d56a2ed91e6b
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Fri Apr 30 19:51:18 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Apr 30 19:51:18 2021 +0200

    openldap: mysterious build failure
    
    Change-Id: I871c54ef548910d8e894ea5ee70c00ad1c720cce

diff --git a/external/openldap/ExternalProject_openldap.mk b/external/openldap/ExternalProject_openldap.mk
index 0c7aaa6ae17d..67adcd06ed3c 100644
--- a/external/openldap/ExternalProject_openldap.mk
+++ b/external/openldap/ExternalProject_openldap.mk
@@ -29,6 +29,7 @@ endif
 $(call gb_ExternalProject_get_state_target,openldap,build) :
 	$(call gb_ExternalProject_run,build,\
 		./configure \
+			 ol_cv_dcl_sys_errlist=no \
 			--disable-slapd \
 			--with-pic \
 			--with-tls=moznss \
commit 17aa06c39b12ee2c52fa814a4029c468f71a7229
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 10 14:19:53 2018 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Apr 1 13:31:14 2021 +0200

    HTML tt -> code in JavaDoc comments
    
    ...to avoid "error: tag not supported in the generated HTML version: tt" with
    JDK 11
    
    Change-Id: I761c987257f42d01f24c88440495698cac6226d2
    Reviewed-on: https://gerrit.libreoffice.org/61614
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 07721a4dea1aab898a993662a24c5ab68ecc1edf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108957
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
index cd751c5af7ef..b0419771870e 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java
@@ -127,9 +127,9 @@ public class InterfaceContainer implements Cloneable
     }
 
     /**
-     * Trims the capacity of this <tt>ArrayList</tt> instance to be the
+     * Trims the capacity of this <code>ArrayList</code> instance to be the
      * list's current size.  An application can use this operation to minimize
-     * the storage of an <tt>ArrayList</tt> instance.
+     * the storage of an <code>ArrayList</code> instance.
      */
     synchronized public void trimToSize()
     {
@@ -143,7 +143,7 @@ public class InterfaceContainer implements Cloneable
     }
 
     /**
-     * Increases the capacity of this <tt>ArrayList</tt> instance, if
+     * Increases the capacity of this <code>ArrayList</code> instance, if
      * necessary, to ensure  that it can hold at least the number of elements
      * specified by the minimum capacity argument.
      *
@@ -167,7 +167,7 @@ public class InterfaceContainer implements Cloneable
      * Appends the specified element to the end of this list.
      *
      * @param o element to be appended to this list.
-     * @return <tt>true</tt> (as per the general contract of Collection.add).
+     * @return <code>true</code> (as per the general contract of Collection.add).
      */
     synchronized public boolean add(Object o)
     {
@@ -189,7 +189,7 @@ public class InterfaceContainer implements Cloneable
      * @param index index at which the specified element is to be inserted.
      * @param element element to be inserted.
      * @throws    IndexOutOfBoundsException if index is out of range
-     *        <tt>(index < 0 || index > size())</tt>.
+     *        <code>(index < 0 || index > size())</code>.
      */
     synchronized public void add(int index, Object element)
     {
@@ -218,8 +218,8 @@ public class InterfaceContainer implements Cloneable
      * list is nonempty.)
      *
      * @param c the elements to be inserted into this list.
-     * @throws    IndexOutOfBoundsException if index out of range <tt>(index
-     *        < 0 || index > size())</tt>.
+     * @throws    IndexOutOfBoundsException if index out of range <code>(index
+     *        < 0 || index > size())</code>.
      * @return true if an element was inserted.
      */
     synchronized public boolean addAll(Collection c)
@@ -247,8 +247,8 @@ public class InterfaceContainer implements Cloneable
      * @param index index at which to insert first element
      *          from the specified collection.
      * @param c elements to be inserted into this list.
-     * @throws    IndexOutOfBoundsException if index out of range <tt>(index
-     *        < 0 || index > size())</tt>.
+     * @throws    IndexOutOfBoundsException if index out of range <code>(index
+     *        < 0 || index > size())</code>.
      * @return true if an element was inserted.
      */
     synchronized public boolean addAll(int index, Collection c)
@@ -304,10 +304,10 @@ public class InterfaceContainer implements Cloneable
         }
     }
     /**
-     * Returns <tt>true</tt> if this list contains the specified element.
+     * Returns <code>true</code> if this list contains the specified element.
      *
      * @param elem element whose presence in this List is to be tested.
-     * @return <tt>true</tt> if this list contains the specified element.
+     * @return <code>true</code> if this list contains the specified element.
      */
     synchronized public boolean contains(Object elem)
     {
@@ -337,8 +337,8 @@ public class InterfaceContainer implements Cloneable
      *
      * @param  index index of element to return.
      * @return the element at the specified position in this list.
-     * @throws    IndexOutOfBoundsException if index is out of range <tt>(index
-     *        < 0 || index >= size())</tt>.
+     * @throws    IndexOutOfBoundsException if index is out of range <code>(index
+     *        < 0 || index >= size())</code>.
      */
     synchronized public Object get(int index)
     {
@@ -352,11 +352,11 @@ public class InterfaceContainer implements Cloneable
 
     /**
      * Searches for the first occurrence of the given argument, testing
-     * for equality using the <tt>equals</tt> method.
+     * for equality using the <code>equals</code> method.
      *
      * @param   elem   an object.
      * @return  the index of the first occurrence of the argument in this
-     *          list; returns <tt>-1</tt> if the object is not found.
+     *          list; returns <code>-1</code> if the object is not found.
      * @see     Object#equals(Object)
      */
     synchronized public int indexOf(Object elem)
@@ -392,8 +392,8 @@ public class InterfaceContainer implements Cloneable
     /**
      * Tests if this list has no elements.
      *
-     * @return  <tt>true</tt> if this list has no elements;
-     *          <tt>false</tt> otherwise.
+     * @return  <code>true</code> if this list has no elements;
+     *          <code>false</code> otherwise.
      */
     synchronized public boolean isEmpty()
     {
@@ -448,10 +448,10 @@ public class InterfaceContainer implements Cloneable
     }
 
     /**
-     * Returns a shallow copy of this <tt>ArrayList</tt> instance. The contained
+     * Returns a shallow copy of this <code>ArrayList</code> instance. The contained
      * references are copied but the objects not.
      *
-     * @return  a clone of this <tt>List</tt> instance.
+     * @return  a clone of this <code>List</code> instance.
      */
     @Override
     synchronized public Object clone()
@@ -492,8 +492,8 @@ public class InterfaceContainer implements Cloneable
      *
      * @param index the index of the element to removed.
      * @return the element that was removed from the list.
-     * @throws    IndexOutOfBoundsException if index out of range <tt>(index
-     *        < 0 || index >= size())</tt>.
+     * @throws    IndexOutOfBoundsException if index out of range <code>(index
+     *        < 0 || index >= size())</code>.
      */
     synchronized public Object remove(int index)
     {
@@ -606,7 +606,7 @@ public class InterfaceContainer implements Cloneable
      * @param element element to be stored at the specified position.
      * @return the element previously at the specified position.
      * @throws    IndexOutOfBoundsException if index out of range
-     *        <tt>(index < 0 || index >= size())</tt>.
+     *        <code>(index < 0 || index >= size())</code>.
      */
     synchronized public Object set(int index, Object element)
     {
@@ -661,9 +661,9 @@ public class InterfaceContainer implements Cloneable
      * If the list fits in the specified array with room to spare (i.e., the
      * array has more elements than the list), the element in the array
      * immediately following the end of the collection is set to
-     * <tt>null</tt>.  This is useful in determining the length of the list
+     * <code>null</code>.  This is useful in determining the length of the list
      * <i>only</i> if the caller knows that the list does not contain any
-     * <tt>null</tt> elements.
+     * <code>null</code> elements.
      *
      * @param a the array into which the elements of the list are to
      *      be stored, if it is big enough; otherwise, a new array of the
commit a66bae4a08e77902d5c7d6c74c4aa7794dfbf97d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Sat Feb 27 22:30:41 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Apr 1 13:28:03 2021 +0200

    gbuild: don't use -Wunused-macros with sccache
    
    In at least soltools, jurt and gperf generated files, build with GCC and
    sccache 0.2.16-alpha.0 reports spurious -Werror=implicit-fallthrough=
    due to comments and these go away by configuring sccache with
    rewrite_includes_only = true.
    
    But his results in
    cc1: error: ‘-fdirectives-only’ is incompatible with ‘-Wunused-macros’
    so disable that like for clang-with-icecream builds.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111716
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 6fb9f368c6824a8ff7bc5bc5cf66fc2df7d055b7)
    
    Change-Id: I6dec38e86aa6e22591d7a700a8daddf3fed88b16

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 2be324b769f8..626bb7683ed0 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -55,7 +55,7 @@ gb_CFLAGS_COMMON := \
 	-Wstrict-prototypes \
 	-Wundef \
 	-Wunreachable-code \
-	$(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \
+	$(if $(or $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),$(findstring sccache,$(CC))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \
@@ -69,7 +69,7 @@ gb_CXXFLAGS_COMMON := \
 	-Wextra \
 	-Wundef \
 	-Wunreachable-code \
-	$(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \
+	$(if $(or $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CXX)),$(findstring icecc,$(CCACHE_PREFIX)))),$(findstring sccache,$(CXX))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \
commit a893c73aefbb8293a87bcfc89b4bfad3fb05e95e
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jul 2 16:55:26 2018 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Apr 1 13:27:56 2021 +0200

    gbuild: avoid -Wunused-macros with clang and icecream+ccache
    
    On Fedora, the recommended way to use icecream with ccache is to set
    CCACHE_PREFIX=icecc - but then $CC does not indicate that icecream is
    used.
    
    Change-Id: Ie757e6c00b07df7664c368c0e9f9c9bc599f3651
    Reviewed-on: https://gerrit.libreoffice.org/56815
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit fa503091cce61b0288645efeeab0937b11fe5403)

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 8edc1bf7b48a..2be324b769f8 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -55,7 +55,7 @@ gb_CFLAGS_COMMON := \
 	-Wstrict-prototypes \
 	-Wundef \
 	-Wunreachable-code \
-	$(if $(and $(COM_IS_CLANG),$(findstring icecc,$(CC))),,-Wunused-macros) \
+	$(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \
@@ -69,7 +69,7 @@ gb_CXXFLAGS_COMMON := \
 	-Wextra \
 	-Wundef \
 	-Wunreachable-code \
-	$(if $(and $(COM_IS_CLANG),$(findstring icecc,$(CXX))),,-Wunused-macros) \
+	$(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \
commit e7e16259a6fa78a45a6cb544b0cb7cc7549b63ef
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue May 29 11:29:31 2018 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Apr 1 13:27:51 2021 +0200

    gbuild: avoid -Wunused-macros with clang and icecream
    
    Apparently the preprocessor leaves in the #define but expands the uses,
    so all macros are reported as unused.
    
    Change-Id: I064a8852ad1080c22440c2b0d05c9dfddcec45f1
    Reviewed-on: https://gerrit.libreoffice.org/54992
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit a404d5525256e3a59948ec4a1894e70179b7d783)

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index ac3cbc366cf7..8edc1bf7b48a 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -55,7 +55,7 @@ gb_CFLAGS_COMMON := \
 	-Wstrict-prototypes \
 	-Wundef \
 	-Wunreachable-code \
-	-Wunused-macros \
+	$(if $(and $(COM_IS_CLANG),$(findstring icecc,$(CC))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \
@@ -69,7 +69,7 @@ gb_CXXFLAGS_COMMON := \
 	-Wextra \
 	-Wundef \
 	-Wunreachable-code \
-	-Wunused-macros \
+	$(if $(and $(COM_IS_CLANG),$(findstring icecc,$(CXX))),,-Wunused-macros) \
 	-finput-charset=UTF-8 \
 	-fmessage-length=0 \
 	-fno-common \


More information about the Libreoffice-commits mailing list