extensions/README.md                         |    6 ++++++
 extensions/source/update/feed/updatefeed.cxx |    4 +++-
 sw/inc/anchoredobject.hxx                    |    2 +-
 sw/inc/dcontact.hxx                          |    7 ++++---
 sw/source/core/doc/docfly.cxx                |    2 +-
 sw/source/core/frmedt/feshview.cxx           |    4 ++--
 sw/source/core/text/txtfrm.cxx               |   16 ++++++++--------
 7 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit c84ffb6114ddb30f474cc87bbd6ad9b591173353
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 24 12:15:40 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 24 14:57:21 2022 +0100

    add some notes on how to debug online update from a dev version
    
    Change-Id: I7b4547bfee4ff0bd3bbe7366b6294e925852ce65
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143221
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/extensions/README.md b/extensions/README.md
index 94cf2acbebd6..cc32c1f825cb 100644
--- a/extensions/README.md
+++ b/extensions/README.md
@@ -16,6 +16,12 @@ we have reached the time when we should ask for the update.  
If yes, asks for
 that, and shows the download button in the menu (if the new update is
 available).
 
+The update server will decide if there is an update available based on the 
user-agent
+string created by UpdateInformationProvider::getUserAgent, the data used there 
is
+extracted from instdir/program/versionrc and the update server takes the 
buildid into
+account, so to experiment with the updates from a dev version getUserAgent 
needs
+to return a recognized id.
+
 ## OLE Automation Bridge
 
 A bridge between "OLE automation" and UNO, so you can use UNO services
diff --git a/extensions/source/update/feed/updatefeed.cxx 
b/extensions/source/update/feed/updatefeed.cxx
index 632724118c98..b1bc6851edef 100644
--- a/extensions/source/update/feed/updatefeed.cxx
+++ b/extensions/source/update/feed/updatefeed.cxx
@@ -365,7 +365,9 @@ OUString UpdateInformationProvider::getUserAgent(bool 
bExtended)
     aUserAgent = aUserAgent.replaceAll("<PRODUCT>", product);
     aUserAgent = aUserAgent.replaceAll("<OPTIONAL_OS_HW_DATA>", aExtended);
     SAL_INFO("extensions.update", "UpdateUserAgent: " << aUserAgent);
-
+    // if you want to debug online updates from a dev version, then 
uncommenting this (adjust for platform)
+    // might be helpful
+    // return "LibreOffice 7.3.5.2 (184fe81b8c8c30d8b5082578aee2fed2ea847c01; 
Linux; X86_64; )";
     return aUserAgent;
 }
 
commit 0a2abff1b0167ce2380e538562755da666c6753b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Nov 24 14:22:23 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Nov 24 14:57:06 2022 +0100

    return SwNode from SwContact::GetContentAnchor
    
    part of the process of making SwFormatAnchor not use an SwPosition
    (because SwFormatAnchor does weird does with the internals of an
    SwPosition)
    
    Change-Id: I662f977214b70fa7eb37e460e4535e14e8a3fe28
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143222
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 35224efdc0b9..114380d6f04d 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -162,7 +162,7 @@ class SW_DLLPUBLIC SwAnchoredObject
         // object positioning
         friend bool sw_HideObj( const SwTextFrame& _rFrame,
                                  const RndStdIds _eAnchorType,
-                                 SwPosition const& rAnchorPos,
+                                 SwFormatAnchor const& rFormatAnchor,
                                  SwAnchoredObject* _pAnchoredObj );
     protected:
         SwAnchoredObject();
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 8bfdb6bdb50a..c10d83c6dec5 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -149,10 +149,11 @@ public:
     bool      ObjAnchoredAtChar() const { return GetAnchorId() == 
RndStdIds::FLY_AT_CHAR; }
     bool      ObjAnchoredAsChar() const { return GetAnchorId() == 
RndStdIds::FLY_AS_CHAR; }
 
-    const SwPosition&  GetContentAnchor() const
+    const SwNode& GetAnchorNode() const
     {
-        assert( GetAnchorFormat().GetContentAnchor() );
-        return *(GetAnchorFormat().GetContentAnchor());
+        const SwNode* pNode = GetAnchorFormat().GetAnchorNode();
+        assert( pNode );
+        return *pNode;
     }
 
     /** get data collection of anchored objects, handled by with contact */
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 0cf7ccc44a5a..685394b0fe19 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -771,7 +771,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
             const RndStdIds eOldAnchorType = pContact->GetAnchorId();
             if ( !_bSameOnly && eOldAnchorType == RndStdIds::FLY_AS_CHAR )
             {
-                oOldAsCharAnchorPos.emplace(pContact->GetContentAnchor());
+                
oOldAsCharAnchorPos.emplace(*pContact->GetAnchorFormat().GetContentAnchor());
             }
 
             if ( _bSameOnly )
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index c4a5d5faac51..e4b517a0759f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1489,8 +1489,8 @@ bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
             SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
             if (pContact && !pContact->ObjAnchoredAtPage() )
             {
-                const SwPosition& rPos = pContact->GetContentAnchor();
-                bool bInHdrFtr = GetDoc()->IsInHeaderFooter( rPos.GetNode() );
+                const SwNode& rAnchorNode = pContact->GetAnchorNode();
+                bool bInHdrFtr = GetDoc()->IsInHeaderFooter( rAnchorNode );
                 if (IsHeaderFooterEdit() != bInHdrFtr)
                 {
                     bRet = false;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 4c483a82edf5..f0400c3cb91d 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1485,7 +1485,7 @@ void SwTextFrame::HideFootnotes(TextFrameIndex const 
nStart, TextFrameIndex cons
  */
 bool sw_HideObj( const SwTextFrame& _rFrame,
                   const RndStdIds _eAnchorType,
-                  SwPosition const& rAnchorPos,
+                  SwFormatAnchor const& rFormatAnchor,
                   SwAnchoredObject* _pAnchoredObj )
 {
     bool bRet( true );
@@ -1499,9 +1499,9 @@ bool sw_HideObj( const SwTextFrame& _rFrame,
               pIDSA->get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) 
&&
              _rFrame.IsInDocBody() && !_rFrame.FindNextCnt() )
         {
-            SwTextNode const& rNode(*rAnchorPos.GetNode().GetTextNode());
+            SwTextNode const& 
rNode(*rFormatAnchor.GetAnchorNode()->GetTextNode());
             assert(FrameContainsNode(_rFrame, rNode.GetIndex()));
-            sal_Int32 const nObjAnchorPos(rAnchorPos.GetContentIndex());
+            sal_Int32 const 
nObjAnchorPos(rFormatAnchor.GetContentAnchor()->GetContentIndex());
             const sal_Unicode cAnchorChar = nObjAnchorPos < rNode.Len()
                 ? rNode.GetText()[nObjAnchorPos]
                 : 0;
@@ -1560,7 +1560,7 @@ void SwTextFrame::HideAndShowObjects()
                 // under certain conditions
                 const RndStdIds eAnchorType( pContact->GetAnchorId() );
                 if ((eAnchorType != RndStdIds::FLY_AT_CHAR) ||
-                    sw_HideObj(*this, eAnchorType, 
pContact->GetContentAnchor(),
+                    sw_HideObj(*this, eAnchorType, pContact->GetAnchorFormat(),
                                  i ))
                 {
                     pContact->MoveObjToInvisibleLayer( pObj );
@@ -1594,13 +1594,13 @@ void SwTextFrame::HideAndShowObjects()
                 {
                     sal_Int32 nHiddenStart;
                     sal_Int32 nHiddenEnd;
-                    const SwPosition& rAnchor = pContact->GetContentAnchor();
+                    const SwFormatAnchor& rAnchorFormat = 
pContact->GetAnchorFormat();
                     SwScriptInfo::GetBoundsOfHiddenRange(
-                        *rAnchor.GetNode().GetTextNode(),
-                        rAnchor.GetContentIndex(), nHiddenStart, nHiddenEnd);
+                        *rAnchorFormat.GetAnchorNode()->GetTextNode(),
+                        rAnchorFormat.GetContentAnchor()->GetContentIndex(), 
nHiddenStart, nHiddenEnd);
                     // Under certain conditions
                     if ( nHiddenStart != COMPLETE_STRING && bShouldBeHidden &&
-                        sw_HideObj(*this, eAnchorType, rAnchor, i))
+                        sw_HideObj(*this, eAnchorType, rAnchorFormat, i))
                     {
                         pContact->MoveObjToInvisibleLayer( pObj );
                     }

Reply via email to