sw/source/filter/html/swhtml.cxx   |   28 ++++++++++++++--------------
 sw/source/uibase/misc/redlndlg.cxx |    6 ++----
 sw/source/uibase/utlui/content.cxx |    5 +----
 3 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit ee03f6453e6f11f3db0742b08c53ad2c6b4ebb63
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Feb 25 21:13:42 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Feb 26 14:51:38 2023 +0000

    cid#1521509 Logically dead code
    
    and
    
    cid#1521507 Logically dead code
    
    Change-Id: I1d2c9ee4a4099fadb5da7a6850b4124488e2ebe8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147687
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index 80e35dec095f..304c4d4a3a50 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -246,8 +246,6 @@ void SwRedlineAcceptDlg::InitAuthors()
 
     SwView *pView = ::GetActiveView();
     SwWrtShell* pSh = pView ? pView->GetWrtShellPtr() : nullptr;
-    if (!pSh)
-        return;
 
     SvxTPFilter *pFilterPage = m_xTabPagesCTRL->GetFilterPage();
 
@@ -1131,12 +1129,12 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, SelectHdl, 
weld::TreeView&, void)
 
 IMPL_LINK_NOARG(SwRedlineAcceptDlg, GotoHdl, Timer *, void)
 {
+    m_aSelectTimer.Stop();
+
     SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
     if (!pSh)
         return;
 
-    m_aSelectTimer.Stop();
-
     bool bIsNotFormated = false;
     bool bSel = false;
 
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 29aac4eadee1..6b22c60dd2ed 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3757,10 +3757,7 @@ IMPL_LINK_NOARG(SwContentTree, TimerUpdate, Timer *, 
void)
     // Query view because the Navigator is cleared too late.
     SwView* pView = GetParentWindow()->GetCreateView();
 
-    if (!pView)
-        return;
-
-    SwWrtShell* pActShell = pView->GetWrtShellPtr();
+    SwWrtShell* pActShell = pView ? pView->GetWrtShellPtr() : nullptr;
     if(pActShell && pActShell->GetWin() &&
         (pActShell->GetWin()->HasFocus() || m_bDocHasChanged || 
m_bViewHasChanged) &&
         !IsInDrag() && !pActShell->ActionPend())
commit 1b7ebea25fb94efa08160792c4eb6ae9e8a9147f
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Feb 25 21:54:46 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Feb 26 14:51:23 2023 +0000

    ofz#56345 Heap-buffer-overflow
    
    happening since:
    
    commit db115bec9254417ef7a3faf687478fe5424ab378
    Date:   Tue Feb 14 18:03:55 2023 +0100
    
        tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl
    
    but due to
    
    commit 29dfcc7521311e547fc069466cc3edc9fcbdbe03
    Date:   Mon Nov 23 16:17:37 2015 +0100
    
        tdf#94088 add import of HTML inline graphics
    
    splitting the condition that used to fall through to default handling
    with an unrelated RES_BACKGROUND case instead
    
    Change-Id: I26a077c755f214cf35582ec146fcf34f87cc4494
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147688
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index f6f52c8a45a3..14dc6b67b2b7 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2950,6 +2950,20 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool 
bBeforeTable,
                     pAttr = pPrev;
                     continue;
 
+                // tdf#94088 expand RES_BACKGROUND to the new fill attribute
+                // definitions in the range [XATTR_FILL_FIRST .. 
XATTR_FILL_LAST].
+                // This is the right place in the future if the adapted fill 
attributes
+                // may be handled more directly in HTML import to handle them.
+                case RES_BACKGROUND:
+                {
+                    const SvxBrushItem& rBrush = static_cast< SvxBrushItem& 
>(*pAttr->m_pItem);
+                    SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> 
aNewSet(m_xDoc->GetAttrPool());
+
+                    setSvxBrushItemAsFillAttributesToTargetSet(rBrush, 
aNewSet);
+                    
m_xDoc->getIDocumentContentOperations().InsertItemSet(aAttrPam, aNewSet, 
SetAttrMode::DONTREPLACE);
+                    break;
+                }
+
                 case RES_LR_SPACE:
                     assert(false);
                     break;
@@ -2967,20 +2981,6 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool 
bBeforeTable,
                     OSL_ENSURE( false,
                             "LRSpace set over multiple paragraphs!" );
                     [[fallthrough]]; // (shouldn't reach this point anyway)
-
-                // tdf#94088 expand RES_BACKGROUND to the new fill attribute
-                // definitions in the range [XATTR_FILL_FIRST .. 
XATTR_FILL_LAST].
-                // This is the right place in the future if the adapted fill 
attributes
-                // may be handled more directly in HTML import to handle them.
-                case RES_BACKGROUND:
-                {
-                    const SvxBrushItem& rBrush = static_cast< SvxBrushItem& 
>(*pAttr->m_pItem);
-                    SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> 
aNewSet(m_xDoc->GetAttrPool());
-
-                    setSvxBrushItemAsFillAttributesToTargetSet(rBrush, 
aNewSet);
-                    
m_xDoc->getIDocumentContentOperations().InsertItemSet(aAttrPam, aNewSet, 
SetAttrMode::DONTREPLACE);
-                    break;
-                }
                 default:
 
                     // maybe jump to a bookmark

Reply via email to