[libreoffice/f15] build f-15
Caolán McNamara
caolanm at fedoraproject.org
Fri Jan 13 15:53:00 UTC 2012
commit 18f0ca67acec0d784bcc104e2d7e0e9768d5c619
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 15:52:55 2012 +0000
build f-15
...-39159-fdo-40482-temp-selection-print-doc.patch | 157 ++++++++++----------
1 files changed, 75 insertions(+), 82 deletions(-)
---
diff --git a/0001-sw-fdo-39159-fdo-40482-temp-selection-print-doc.patch b/0001-sw-fdo-39159-fdo-40482-temp-selection-print-doc.patch
index 84e0ad2..751b515 100644
--- a/0001-sw-fdo-39159-fdo-40482-temp-selection-print-doc.patch
+++ b/0001-sw-fdo-39159-fdo-40482-temp-selection-print-doc.patch
@@ -1,36 +1,3 @@
-From 33f81021eb4e794537de9a4208d79f70a357ff3e Mon Sep 17 00:00:00 2001
-From: Michael Stahl <mstahl at redhat.com>
-Date: Wed, 21 Dec 2011 16:39:22 +0100
-Subject: [PATCH] sw: fdo#39159 fdo#40482: temp selection print doc:
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Ensure that the printing temp selection document is not destroyed
-prematurely by SwXTextView::NotifySelChanged, called via
-ViewOptionAdjustStop, by retaining the temp doc object shell not
-at the View but in SwRenderData.
-
-Not restoring the view options for selections does not actually work,
-because having a selection surprisingly does not imply printing a
-temp document: the preview also uses a selection.
-(view option regression from cd690d2e72be410058376c416a40ff5d918fb0f7)
-
-backport of 89d2733e16ae6233deea6bef3193bd45c89b854c
-
-Signed-off-by: Caolán McNamara <caolanm at redhat.com>
----
- sw/inc/printdata.hxx | 11 +++++++++--
- sw/inc/unotxdoc.hxx | 3 +--
- sw/source/core/view/printdata.cxx | 13 +++++++++++--
- sw/source/ui/inc/view.hxx | 3 +--
- sw/source/ui/uiview/view.cxx | 18 ++++--------------
- sw/source/ui/uno/unotxdoc.cxx | 33 +++++++++++++++++++++------------
- sw/source/ui/uno/unotxvw.cxx | 8 --------
- 7 files changed, 47 insertions(+), 42 deletions(-)
-
-diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
-index 99c5cb4..e90508f 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -32,6 +32,7 @@
@@ -52,12 +19,7 @@ index 99c5cb4..e90508f 100644
// the view options to be applied for printing
SwViewOptionAdjust_Impl * m_pViewOptionAdjust;
-@@ -262,14 +267,16 @@
- SwRenderData();
- ~SwRenderData();
-
--
- bool HasPostItData() const { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; }
+@@ -267,9 +272,12 @@
void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev );
void DeletePostItData();
@@ -71,11 +33,9 @@ index 99c5cb4..e90508f 100644
void ViewOptionAdjust( const SwPrtOptions *pPrtOptions );
void ViewOptionAdjustStop();
-diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
-index ab8ae52..ca8ee42 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
-@@ -600,12 +600,11 @@ class SwViewOptionAdjust_Impl
+@@ -600,12 +600,11 @@
{
SwWrtShell & m_rShell;
SwViewOption m_aOldViewOptions;
@@ -89,17 +49,12 @@ index ab8ae52..ca8ee42 100644
~SwViewOptionAdjust_Impl();
void AdjustViewOptions( const SwPrtOptions *pPrtOptions );
-diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
-index a60bd67..c904738 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
-@@ -110,7 +110,16 @@
- m_pPostItShell = 0;
- m_pPostItFields = 0;
+@@ -112,19 +112,28 @@
}
--}
-+}
-+
+ }
+
+SfxObjectShellLock const& SwRenderData::GetTempDocShell() const
+{
+ return m_xTempDocShell;
@@ -108,10 +63,10 @@ index a60bd67..c904738 100644
+{
+ m_xTempDocShell = xShell;
+}
-
++
bool SwRenderData::NeedNewViewOptionAdjust( const SwWrtShell& rCompare ) const
{
-@@ -118,13 +127,13 @@
+ return m_pViewOptionAdjust ? ! m_pViewOptionAdjust->checkShell( rCompare ) : true;
}
@@ -127,8 +82,6 @@ index a60bd67..c904738 100644
}
-diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
-index 57ca1c9..cf39873 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -643,8 +643,7 @@
@@ -141,8 +94,6 @@ index 57ca1c9..cf39873 100644
void AddTransferable(SwTransferable& rTransferable);
-diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
-index c0eb7f4..f6912af 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1878,21 +1878,10 @@
@@ -170,19 +121,80 @@ index c0eb7f4..f6912af 100644
}
void SwView::AddTransferable(SwTransferable& rTransferable)
-diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
-index 8fad3d7..490dec8 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
-@@ -851,7 +851,7 @@
+@@ -2439,7 +2439,16 @@
+ const TypeId aSwViewTypeId = TYPE(SwView);
+ if (rpView && rpView->IsA(aSwViewTypeId))
+ {
+- SfxObjectShellRef xDocSh(((SwView*)rpView)->GetOrCreateTmpSelectionDoc());
++ OSL_ENSURE(m_pRenderData, "GetRenderDoc: no renderdata");
++ if (!m_pRenderData)
++ return 0;
++ SwView *const pSwView(static_cast<SwView *>(rpView));
++ SfxObjectShellLock xDocSh(m_pRenderData->GetTempDocShell());
++ if (!xDocSh.Is())
++ {
++ xDocSh = pSwView->CreateTmpSelectionDoc();
++ m_pRenderData->SetTempDocShell(xDocSh);
++ }
+ if (xDocSh.Is())
+ {
+ pDoc = ((SwDocShell*)&xDocSh)->GetDoc();
+@@ -2555,7 +2564,10 @@
+ if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) )
+ m_pRenderData->ViewOptionAdjustStop();
+ if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust())
+- m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions(), rSelection.hasValue() );
++ {
++ m_pRenderData->ViewOptionAdjustStart(
++ *pWrtShell, *pWrtShell->GetViewOptions() );
++ }
+ }
+
+ m_pRenderData->SetSwPrtOptions( new SwPrtOptions( C2U( bIsPDFExport ? "PDF export" : "Printing" ) ) );
+@@ -3823,21 +3835,15 @@
+ m_pDoc->SetModified();
+ }
+
+-SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions, bool bIsTmpSelection ) :
++SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) :
+ m_rShell( rSh ),
+- m_aOldViewOptions( rViewOptions ),
+- m_bIsTmpSelection( bIsTmpSelection )
++ m_aOldViewOptions( rViewOptions )
+ {
+ }
+
+ SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl()
+ {
+- //fdo#39159 don't restore original view options on a temporary document
+- //selection, it triggers throwing away the current view. Presumably we can
+- //forget about it in the temporary document case as unimportant to restore
+- //the original view settings
+- if (!m_bIsTmpSelection)
+- m_rShell.ApplyViewOptions( m_aOldViewOptions );
++ m_rShell.ApplyViewOptions( m_aOldViewOptions );
+ }
+
+ void SwViewOptionAdjust_Impl::AdjustViewOptions(
+--- a/sw/source/ui/uno/unotxvw.cxx
++++ b/sw/source/ui/uno/unotxvw.cxx
+@@ -851,12 +851,12 @@
pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 );
}
-SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ )
-+SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc()
++SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc()
{
SwWrtShell& rOldSh = m_pView->GetWrtShell();
SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess()->getPrinter( false );
+ SwDocShell* pDocSh;
+- SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) );
++ SfxObjectShellLock xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) );
+ xDocSh->DoInitNew( 0 );
+ rOldSh.FillPrtDoc(pDocSh->GetDoc(), pPrt);
+ SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
@@ -887,14 +887,6 @@
{
OSL_ENSURE( m_pView, "view is missing" );
@@ -198,33 +210,14 @@ index 8fad3d7..490dec8 100644
uno::Reference< uno::XInterface > xInt = (cppu::OWeakObject*)(SfxBaseController*)this;
lang::EventObject aEvent(xInt);
-diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
-index 1c1fca6..3d6c36a 100644
---- a/sw/source/ui/uno/unotxvw.cxx
-+++ b/sw/source/ui/uno/unotxvw.cxx
-@@ -886,14 +886,6 @@ void SwXTextView::NotifySelChanged()
- {
- OSL_ENSURE( m_pView, "view is missing" );
-
-- // destroy temporary document with selected text that is used
-- // in PDF export of (multi-)selections.
-- if (m_pView && m_pView->GetTmpSelectionDoc().Is())
-- {
-- m_pView->GetTmpSelectionDoc()->DoClose();
-- m_pView->GetTmpSelectionDoc() = 0;
-- }
--
- uno::Reference< uno::XInterface > xInt = (cppu::OWeakObject*)(SfxBaseController*)this;
-
- lang::EventObject aEvent(xInt);
---- a/sw/source/ui/inc/unotxvw.hxx 2012-01-13 09:07:34.213536169 +0000
-+++ b/sw/source/ui/inc/unotxvw.hxx 2012-01-13 09:07:40.815605630 +0000
+--- a/sw/source/ui/inc/unotxvw.hxx 2012-01-13 14:55:40.347525516 +0000
++++ b/sw/source/ui/inc/unotxvw.hxx 2012-01-13 14:56:24.179060267 +0000
@@ -154,7 +154,7 @@
void Invalidate();
// temporary document used for PDF export of selections/multi-selections
- SfxObjectShellRef BuildTmpSelectionDoc( SfxObjectShellRef& );
-+ SfxObjectShellLock BuildTmpSelectionDoc();
++ SfxObjectShellLock BuildTmpSelectionDoc();
};
typedef cppu::WeakImplHelper8<
More information about the scm-commits
mailing list