[libreoffice/f20] Resolves: rhbz#1089340 nasty calc search/replace code

Caolán McNamara caolanm at fedoraproject.org
Tue Apr 22 15:24:25 UTC 2014


commit 7ab73c05a7fa8b1f7bb55a8a92d19d32d6ae671e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 22 16:24:17 2014 +0100

    Resolves: rhbz#1089340 nasty calc search/replace code

 ...-71423-crash-while-editing-Impress-tables.patch |   40 +++++++
 ...z-1088625-PresenterPaintManager-seen-as-N.patch |   54 +++++++++
 ...-numbered-print-job-is-reported-as-failed.patch |  120 ++++++++++++++++++++
 ...-Let-s-do-it-in-a-straightforward-fashion.patch |   35 ++++++
 ...ot-resizing-when-rows-columns-added-to-it.patch |   59 ++++++++++
 libreoffice.spec                                   |   12 ++-
 6 files changed, 319 insertions(+), 1 deletions(-)
---
diff --git a/0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch b/0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch
new file mode 100644
index 0000000..4780c83
--- /dev/null
+++ b/0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch
@@ -0,0 +1,40 @@
+From 4128c63d655869e0ab7befde2c46761d8e1b273f Mon Sep 17 00:00:00 2001
+From: Thorsten Behrens <thb at documentfoundation.org>
+Date: Thu, 10 Apr 2014 19:40:54 +0200
+Subject: [PATCH] Fix fdo#71423 - crash while editing Impress tables.
+
+Band-aid fix for this nasty crasher, seems sometimes the
+family item is not found.
+
+Change-Id: I7f78d59cbf2c9595ad512fa7a78370629924cd06
+(cherry picked from commit 058cfa72dcdd91df302be45f7fc59b0d961a420b)
+Signed-off-by: Andras Timar <andras.timar at collabora.com>
+---
+ sfx2/source/dialog/templdlg.cxx | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
+index ecc4d41..cbd856f 100644
+--- a/sfx2/source/dialog/templdlg.cxx
++++ b/sfx2/source/dialog/templdlg.cxx
+@@ -1245,6 +1245,8 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
+     if(pStyleSheetPool && nActFamily != 0xffff)
+     {
+         const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
++        if(!pItem)
++            return;
+         pStyleSheetPool->SetSearchMask(pItem->GetFamily(), SFXSTYLEBIT_ALL_VISIBLE);
+         StyleTreeArr_Impl aArr;
+         SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
+@@ -1589,7 +1591,7 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
+          // other filters for automatic
+          CheckItem( nActFamily, sal_True );
+          const SfxStyleFamilyItem *pStyleItem =  GetFamilyItem_Impl();
+-         if (  0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags
++         if ( pStyleItem && 0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags
+             && nAppFilter != pItem->GetValue())
+          {
+              nAppFilter = pItem->GetValue();
+-- 
+1.9.0
+
diff --git a/0001-Related-rhbz-1088625-PresenterPaintManager-seen-as-N.patch b/0001-Related-rhbz-1088625-PresenterPaintManager-seen-as-N.patch
new file mode 100644
index 0000000..988b1fc
--- /dev/null
+++ b/0001-Related-rhbz-1088625-PresenterPaintManager-seen-as-N.patch
@@ -0,0 +1,54 @@
+From b2e9afcdfb0d9cd4d5c1b1073ad325403a13ef32 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Fri, 18 Apr 2014 09:45:38 +0100
+Subject: [PATCH] Related: rhbz#1088625 PresenterPaintManager seen as NULL
+
+Change-Id: I3b7ba51d48ebc5f9304f6125de0595d41d50ad4d
+---
+ sdext/source/presenter/PresenterToolBar.cxx | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
+index dd0ca91..4c825ed 100644
+--- a/sdext/source/presenter/PresenterToolBar.cxx
++++ b/sdext/source/presenter/PresenterToolBar.cxx
+@@ -457,7 +457,10 @@ void PresenterToolBar::InvalidateArea (
+     const awt::Rectangle& rRepaintBox,
+     const bool bSynchronous)
+ {
+-    mpPresenterController->GetPaintManager()->Invalidate(
++    ::boost::shared_ptr<PresenterPaintManager> xManager(mpPresenterController->GetPaintManager());
++    if (!xManager)
++        return;
++    xManager->Invalidate(
+         mxWindow,
+         rRepaintBox,
+         bSynchronous);
+@@ -467,7 +470,11 @@ void PresenterToolBar::RequestLayout (void)
+ {
+     mbIsLayoutPending = true;
+ 
+-    mpPresenterController->GetPaintManager()->Invalidate(mxWindow);
++    ::boost::shared_ptr<PresenterPaintManager> xManager(mpPresenterController->GetPaintManager());
++    if (!xManager)
++        return;
++
++    xManager->Invalidate(mxWindow);
+ }
+ 
+ geometry::RealSize2D PresenterToolBar::GetMinimalSize (void)
+@@ -822,7 +829,10 @@ void PresenterToolBar::Layout (
+     }
+ 
+     // The whole window has to be repainted.
+-    mpPresenterController->GetPaintManager()->Invalidate(mxWindow);
++    ::boost::shared_ptr<PresenterPaintManager> xManager(mpPresenterController->GetPaintManager());
++    if (!xManager)
++        return;
++    xManager->Invalidate(mxWindow);
+ }
+ 
+ geometry::RealSize2D PresenterToolBar::CalculatePartSize (
+-- 
+1.9.0
+
diff --git a/0001-every-even-numbered-print-job-is-reported-as-failed.patch b/0001-every-even-numbered-print-job-is-reported-as-failed.patch
new file mode 100644
index 0000000..a19a334
--- /dev/null
+++ b/0001-every-even-numbered-print-job-is-reported-as-failed.patch
@@ -0,0 +1,120 @@
+From 2dae70268e8f53b11301c4c8490efea57b0cc51c Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at redhat.com>
+Date: Thu, 9 Jan 2014 23:09:12 +0100
+Subject: [PATCH] every even numbered print job is reported as failed
+
+because of.
+bool bSuccess;
+...
+bSuccess &= ...endSpool(...);
+
+in PspSalPrinter::StartJob
+
+was...
+
+endSpool return value is effectively success flag, not job ID
+
+(cherry picked from commit e6323214830895d1c76ec44ee53990bf577fbda2)
+
+Change-Id: I5b96eeff80ca29f0f8f24ee6da7a2ca76cbb05ce
+---
+ include/vcl/printerinfomanager.hxx             | 4 ++--
+ vcl/generic/print/printerjob.cxx               | 2 +-
+ vcl/inc/cupsmgr.hxx                            | 2 +-
+ vcl/null/printerinfomanager.cxx                | 2 +-
+ vcl/unx/generic/printer/cupsmgr.cxx            | 4 ++--
+ vcl/unx/generic/printer/printerinfomanager.cxx | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/include/vcl/printerinfomanager.hxx b/include/vcl/printerinfomanager.hxx
+index 96e7846..7e3ccd6 100644
+--- a/include/vcl/printerinfomanager.hxx
++++ b/include/vcl/printerinfomanager.hxx
+@@ -211,8 +211,8 @@ public:
+     // close the FILE* returned by startSpool and does the actual spooling
+     // set bBanner to "false" will attempt to suppress banner printing
+     // set bBanner to "true" will rely on the system default
+-    // returns a numerical job id
+-    virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
++    // returns true on success
++    virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+ 
+     // for spadmin: whether adding or removing a printer is possible
+     virtual bool addOrRemovePossible() const;
+diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
+index 7c1b359..f611c26 100644
+--- a/vcl/generic/print/printerjob.cxx
++++ b/vcl/generic/print/printerjob.cxx
+@@ -530,7 +530,7 @@ PrinterJob::EndJob ()
+     else
+     {
+         PrinterInfoManager& rPrinterInfoManager = PrinterInfoManager::get();
+-        if (0 == rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
++        if (!rPrinterInfoManager.endSpool( m_aLastJobData.m_aPrinterName,
+             maJobTitle, pDestFILE, m_aDocumentJobData, true ))
+         {
+             bSuccess = sal_False;
+diff --git a/vcl/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx
+index 8c659fe..a8c06bb 100644
+--- a/vcl/inc/cupsmgr.hxx
++++ b/vcl/inc/cupsmgr.hxx
+@@ -78,7 +78,7 @@ public:
+     const char* authenticateUser( const char* );
+ 
+     virtual FILE* startSpool( const OUString& rPrinterName, bool bQuickCommand );
+-    virtual int endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
++    virtual bool endSpool( const OUString& rPrinterName, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner );
+     virtual void setupJobContextData( JobData& rData );
+ 
+     /// changes the info about a named printer
+diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx
+index a480856..4845ec3 100644
+--- a/vcl/null/printerinfomanager.cxx
++++ b/vcl/null/printerinfomanager.cxx
+@@ -147,7 +147,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& /* rPrintername */, bool /
+     return NULL;
+ }
+ 
+-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
++bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* /* pFile */, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+ {
+     return true;
+ }
+diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
+index 069df7d..ecf44e7 100644
+--- a/vcl/unx/generic/printer/cupsmgr.cxx
++++ b/vcl/unx/generic/printer/cupsmgr.cxx
+@@ -640,7 +640,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
+     }
+ }
+ 
+-int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
++bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTitle, FILE* pFile, const JobData& rDocumentJobData, bool bBanner )
+ {
+     OSL_TRACE( "endSpool: %s, %s, copy count = %d",
+                OUStringToOString( rPrintername, RTL_TEXTENCODING_UTF8 ).getStr(),
+@@ -699,7 +699,7 @@ int CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTit
+             cupsFreeOptions( nNumOptions, pOptions );
+     }
+ 
+-    return nJobID;
++    return nJobID != 0;
+ }
+ 
+ 
+diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
+index 4f8f56e..45b9f62 100644
+--- a/vcl/unx/generic/printer/printerinfomanager.cxx
++++ b/vcl/unx/generic/printer/printerinfomanager.cxx
+@@ -1117,7 +1117,7 @@ FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickC
+     return popen (aShellCommand.getStr(), "w");
+ }
+ 
+-int PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
++bool PrinterInfoManager::endSpool( const OUString& /*rPrintername*/, const OUString& /*rJobTitle*/, FILE* pFile, const JobData& /*rDocumentJobData*/, bool /*bBanner*/ )
+ {
+     return (0 == pclose( pFile ));
+ }
+-- 
+1.9.0
+
diff --git a/0001-fdo-75970-Let-s-do-it-in-a-straightforward-fashion.patch b/0001-fdo-75970-Let-s-do-it-in-a-straightforward-fashion.patch
new file mode 100644
index 0000000..2d1a315
--- /dev/null
+++ b/0001-fdo-75970-Let-s-do-it-in-a-straightforward-fashion.patch
@@ -0,0 +1,35 @@
+From db9a3bf0d7d14d945b9a371b485ecadba81a5919 Mon Sep 17 00:00:00 2001
+From: Kohei Yoshida <kohei.yoshida at collabora.com>
+Date: Fri, 11 Apr 2014 12:31:29 -0400
+Subject: [PATCH] fdo#75970: Let's do it in a straightforward fashion.
+
+No idea what the intent of this weird static heap instantiation, but
+apparently it's not helping us.
+
+Change-Id: If6cccf649958b6cf01ede992c286af68eaeb31f6
+(cherry picked from commit 0ffe4358c755504bc2754ef88edadde33b5f395a)
+Reviewed-on: https://gerrit.libreoffice.org/8939
+Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
+Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
+---
+ sc/source/ui/view/viewfun2.cxx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
+index 800523e..241d5dd 100644
+--- a/sc/source/ui/view/viewfun2.cxx
++++ b/sc/source/ui/view/viewfun2.cxx
+@@ -1638,8 +1638,8 @@ void ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
+ 
+             if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL)
+             {
+-                static SearchResults *aSearchResults = new SearchResults(pDoc);
+-                aSearchResults->Show(aMatchedRanges);
++                SearchResults aSearchResults(pDoc);
++                aSearchResults.Show(aMatchedRanges);
+ 
+                 rMark.ResetMark();
+                 for (size_t i = 0, n = aMatchedRanges.size(); i < n; ++i)
+-- 
+1.9.0
+
diff --git a/0001-table-not-resizing-when-rows-columns-added-to-it.patch b/0001-table-not-resizing-when-rows-columns-added-to-it.patch
new file mode 100644
index 0000000..d72c4e7
--- /dev/null
+++ b/0001-table-not-resizing-when-rows-columns-added-to-it.patch
@@ -0,0 +1,59 @@
+From bbcfb0a054efbe3aa106bff62938e218fea91d29 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Tue, 22 Apr 2014 12:05:48 +0100
+Subject: [PATCH] table not resizing when rows/columns added to it
+
+I happened across a presentation whose table didn't resize when extra rows and
+columns were added to it. It worked on a higher resolution machine, but not on
+a 1024x768 one
+
+Change-Id: I98a7a04bee0b0175174e6376e9ebc046b9eff2dc
+(cherry picked from commit 88c3b4bbf005299203370efecbc09dd9d9d26a72)
+---
+ svx/source/table/svdotable.cxx | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
+index d59c166..45c6a30 100644
+--- a/svx/source/table/svdotable.cxx
++++ b/svx/source/table/svdotable.cxx
+@@ -248,6 +248,8 @@ private:
+     static bool lastLayoutFitWidth;
+     static bool lastLayoutFitHeight;
+     static WritingMode lastLayoutMode;
++    static sal_Int32 lastRowCount;
++    static sal_Int32 lastColCount;
+ };
+ 
+ SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = NULL;
+@@ -255,6 +257,8 @@ Rectangle SdrTableObjImpl::lastLayoutRectangle;
+ bool SdrTableObjImpl::lastLayoutFitWidth;
+ bool SdrTableObjImpl::lastLayoutFitHeight;
+ WritingMode SdrTableObjImpl::lastLayoutMode;
++sal_Int32 SdrTableObjImpl::lastRowCount;
++sal_Int32 SdrTableObjImpl::lastColCount;
+ 
+ // -----------------------------------------------------------------------------
+ 
+@@ -696,13 +700,17 @@ void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHe
+         WritingMode writingMode = mpTableObj->GetWritingMode();
+         if( lastLayoutTable != this || lastLayoutRectangle != rArea
+             || lastLayoutFitWidth != bFitWidth || lastLayoutFitHeight != bFitHeight
+-            || lastLayoutMode != writingMode )
++            || lastLayoutMode != writingMode
++            || lastRowCount != getRowCount()
++            || lastColCount != getColumnCount() )
+         {
+             lastLayoutTable = this;
+             lastLayoutRectangle = rArea;
+             lastLayoutFitWidth = bFitWidth;
+             lastLayoutFitHeight = bFitHeight;
+             lastLayoutMode = writingMode;
++            lastRowCount = getRowCount();
++            lastColCount = getColumnCount();
+             TableModelNotifyGuard aGuard( mxTable.get() );
+             mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
+         }
+-- 
+1.9.0
+
diff --git a/libreoffice.spec b/libreoffice.spec
index fdcbb2c..01f368f 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -42,7 +42,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        %{libo_version}.3
-Release:        6%{?libo_prerelease}%{?dist}
+Release:        7%{?libo_prerelease}%{?dist}
 License:        (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
 Group:          Applications/Productivity
 URL:            http://www.libreoffice.org/default/
@@ -297,6 +297,11 @@ Patch32: 0001-fix-libetonyek-build.patch
 Patch33: 0001-Resolves-fdo-36815-enable-printing-WYSIWYG-sidewindo.patch
 Patch34: 0001-Related-fdo-36815-print-the-text-highlight-range-as-.patch
 Patch35: 0001-Resolves-rhbz-1086714-overlarge-pixmap.patch
+Patch36: 0001-every-even-numbered-print-job-is-reported-as-failed.patch
+Patch37: 0001-Related-rhbz-1088625-PresenterPaintManager-seen-as-N.patch
+Patch38: 0001-table-not-resizing-when-rows-columns-added-to-it.patch
+Patch39: 0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch
+Patch40: 0001-fdo-75970-Let-s-do-it-in-a-straightforward-fashion.patch
 
 %define instdir %{_libdir}
 %define baseinstdir %{instdir}/libreoffice
@@ -2288,6 +2293,11 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
+* Tue Apr 22 2014 Caolán McNamara <caolanm at redhat.com> - 1:4.2.3.3-7
+- Resolves: rhbz#1089340 crash on search+replace + close + searchreplace
+  in calc
+- Resolves: rhbz#1088625 crash in presentation console
+
 * Wed Apr 16 2014 David Tardon <dtardon at redhat.com> - 1:4.2.3.3-6
 - install man pages
 - Resolves: rhbz#1086714 overlarge pixmap


More information about the scm-commits mailing list