sc/source/ui/condformat/condformateasydlg.cxx |    3 ++
 sd/source/ui/unoidl/unomodel.cxx              |    5 ++--
 sw/source/core/text/guess.cxx                 |   26 +++++++++++++++++++-----
 sw/source/uibase/app/docst.cxx                |   28 +++++++++++++++++---------
 4 files changed, 46 insertions(+), 16 deletions(-)

New commits:
commit b67ae93c2321a93ac3fd74ba05bcbf428665b912
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Aug 22 17:45:12 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Aug 26 10:52:25 2024 +0200

    crashtesting: crash on hyphenation of ooo56629-9.odt
    
    a problem I think since:
    
    commit b5e275f47a54bd7fee39dad516a433fde5be872d
    CommitDate: Fri Jan 19 17:37:41 2024 +0100
    
        tdf#106733 sw: implement CharNoHyphenation
    
    Change-Id: Ic49c136019e93f79818bec7811317bb4f37d6ac1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172287
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit c06eee519d8a235385b4910d9ec96e5492dd0e9b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172267
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index c4f74de7cef7..3c8a3512b327 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -582,12 +582,28 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, 
SwTextFormatInfo &rInf,
 
         m_nBreakStart = m_nBreakPos;
 
-        bHyph = BreakType::HYPHENATION == aResult.breakType &&
+        bHyph = BreakType::HYPHENATION == aResult.breakType;
+        if (bHyph)
+        {
+            LanguageType aNoHyphLang;
+            if (rPor.InFieldGrp())
+            {
+                // If we are inside a field portion, we use a temporary string 
which
+                // differs from the string at the textnode. Therefore we are 
not allowed
+                // to call the GetLangOfChar function.
+                aNoHyphLang = LANGUAGE_DONTKNOW;
+            }
+            else
+            {
                 // allow hyphenation of the word only if it's not disabled by 
character formatting
-                LANGUAGE_NONE != rInf.GetTextFrame()->GetLangOfChar(
-                        TextFrameIndex( sal_Int32(m_nBreakPos) +
-                                aResult.rHyphenatedWord->getHyphenationPos() ),
-                        1, true, /*bNoneIfNoHyphenation=*/true );
+                aNoHyphLang = rInf.GetTextFrame()->GetLangOfChar(
+                                  TextFrameIndex( sal_Int32(m_nBreakPos) +
+                                            
aResult.rHyphenatedWord->getHyphenationPos() ),
+                                    1, true, /*bNoneIfNoHyphenation=*/true );
+            }
+            // allow hyphenation of the word only if it's not disabled by 
character formatting
+            bHyph = aNoHyphLang != LANGUAGE_NONE;
+        }
 
         if (bHyph && m_nBreakPos != TextFrameIndex(COMPLETE_STRING))
         {
commit 98ea93c9f3193d13dee03f3664cb4e58ba2364ae
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Aug 22 12:04:30 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Aug 26 10:52:25 2024 +0200

    null deref seen in SdXImpressDocument::getPostIts
    
    Change-Id: Idb222476c6d2a6bb8e3ffea528ec4bed0c869ac8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172249
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 991cf2a037bf..34b2ec5a76c5 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3427,12 +3427,13 @@ Size SdXImpressDocument::getDocumentSize()
 void SdXImpressDocument::getPostIts(::tools::JsonWriter& rJsonWriter)
 {
     auto commentsNode = rJsonWriter.startNode("comments");
+    if (!mpDoc)
+        return;
     // Return annotations on master pages too ?
     const sal_uInt16 nMaxPages = mpDoc->GetPageCount();
-    SdrPage* pPage;
     for (sal_uInt16 nPage = 0; nPage < nMaxPages; ++nPage)
     {
-        pPage = mpDoc->GetPage(nPage);
+        SdrPage* pPage = mpDoc->GetPage(nPage);
 
         for (auto const& xAnnotation : pPage->getAnnotations())
         {
commit 9106cf29ef4f4f60eaea33e3c30e557a3d4aa88f
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Aug 17 14:17:43 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Aug 26 10:52:24 2024 +0200

    cid#1616505 Uninitialized scalar field
    
    Change-Id: I6521d25f7763ebe7f1b0d1213ab641c284c5e228
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171971
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index 4042507036c9..5955304a86ca 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -62,6 +62,9 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
     , mpParent(pParent)
     , mpViewData(pViewData)
     , mpDocument(&mpViewData->GetDocument())
+    , mbIsManaged(false)
+    , mnFormatKey(0)
+    , mnEntryIndex(0)
     , mxNumberEntry(m_xBuilder->weld_entry("entryNumber"))
     , mxNumberEntry2(m_xBuilder->weld_entry("entryNumber2"))
     , mxAllInputs(m_xBuilder->weld_container("allInputs"))
commit 4f7a31bf6c66e8c2417a205517e3531995d62279
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Aug 13 13:07:10 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Aug 26 10:52:24 2024 +0200

    fix null deref on fetching postit outliner
    
    Change-Id: I950c2c2e68090ad002401d3ff038dcd3d18e7da2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171770
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ba6c850a86d0..4690cebd5306 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -88,6 +88,17 @@
 
 using namespace ::com::sun::star;
 
+static OutlinerView* lcl_GetPostItOutlinerView(SwWrtShell& rShell)
+{
+    SwPostItMgr* pPostItMgr = rShell.GetPostItMgr();
+    if (!pPostItMgr)
+        return nullptr;
+    sw::annotation::SwAnnotationWin* pWin = pPostItMgr->GetActiveSidebarWin();
+    if (!pWin)
+        return nullptr;
+    return pWin->GetOutlinerView();
+}
+
 void  SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
 {
     SfxWhichIter aIter(rSet);
@@ -133,8 +144,8 @@ void  SwDocShell::StateStyleSheet(SfxItemSet& rSet, 
SwWrtShell* pSh)
                 }
                 else if (pShell->GetSelectionType() == SelectionType::PostIt)
                 {
-                    auto pStyle = 
pShell->GetPostItMgr()->GetActiveSidebarWin()->GetOutlinerView()->GetStyleSheet();
-                    if (pStyle)
+                    OutlinerView *pOLV = lcl_GetPostItOutlinerView(*pShell);
+                    if (SfxStyleSheetBase* pStyle = pOLV ? 
pOLV->GetStyleSheet() : nullptr)
                         aName = pStyle->GetName();
                 }
                 else
@@ -164,7 +175,8 @@ void  SwDocShell::StateStyleSheet(SfxItemSet& rSet, 
SwWrtShell* pSh)
                     OUString aProgName;
                     if (pShell->GetSelectionType() == SelectionType::PostIt)
                     {
-                        if (auto pStyle = 
pShell->GetPostItMgr()->GetActiveSidebarWin()->GetOutlinerView()->GetStyleSheet())
+                        OutlinerView *pOLV = 
lcl_GetPostItOutlinerView(*pShell);
+                        if (SfxStyleSheetBase* pStyle = pOLV ? 
pOLV->GetStyleSheet() : nullptr)
                         {
                             aName = pStyle->GetName();
                             aProgName = SwStyleNameMapper::GetProgName(aName, 
SwGetPoolIdFromName::TxtColl);
@@ -410,8 +422,8 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
                     {
                         if (GetWrtShell()->GetSelectionType() == 
SelectionType::PostIt)
                         {
-                            auto pOLV = 
GetWrtShell()->GetPostItMgr()->GetActiveSidebarWin()->GetOutlinerView();
-                            if (auto pStyle = pOLV->GetStyleSheet())
+                            OutlinerView *pOLV = 
lcl_GetPostItOutlinerView(*GetWrtShell());
+                            if (SfxStyleSheetBase* pStyle = pOLV ? 
pOLV->GetStyleSheet() : nullptr)
                                 aParam = pStyle->GetName();
                         }
                         else if (auto pColl = 
GetWrtShell()->GetCurTextFormatColl())
@@ -1185,10 +1197,8 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString 
&rName, SfxStyleFamily nFa
         }
         case SfxStyleFamily::Para:
         {
-            if (pSh->GetPostItMgr() && 
pSh->GetPostItMgr()->HasActiveSidebarWin())
-            {
-                
pSh->GetPostItMgr()->GetActiveSidebarWin()->GetOutlinerView()->SetStyleSheet(rName);
-            }
+            if (OutlinerView *pOLV = lcl_GetPostItOutlinerView(*pSh))
+                pOLV->SetStyleSheet(rName);
             else
             {
                 // When outline-folding is enabled, 
MakeAllOutlineContentTemporarilyVisible makes

Reply via email to