Resolves: fdo#60040 crash after undoing master page

f41
Caolán McNamara 11 years ago
parent 27ad37c6bf
commit cbd193417a

@ -0,0 +1,104 @@
From 9fd97266ce7dbeac33c93b6dace69d64c02d222c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 23 Apr 2014 15:22:13 +0100
Subject: [PATCH] Related: fdo#36815 center scaled comment page vertically
so comments at the top of the page don't get clipped
off the true printable area
Change-Id: Icb796c901372437b276e7ce4e31c08e0bf2ec250
---
sw/source/core/view/vprint.cxx | 56 +++++++++++++++---------------------------
1 file changed, 20 insertions(+), 36 deletions(-)
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index b680e52..0022fff 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -455,26 +455,6 @@ sal_Bool SwViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Push();
- // fdo#36815 for comments in margins print to a metafile
- // and then scale that metafile down so that the comments
- // will fit on the real page, and replay that scaled
- // output to the real outputdevice
- GDIMetaFile *pOrigRecorder(NULL);
- GDIMetaFile *pMetaFile(NULL);
- sal_Int16 nPostItMode = rPrintData.GetPrintPostIts();
- if (nPostItMode == POSTITS_INMARGINS)
- {
- //get and disable the existing recorder
- pOrigRecorder = pOutDev->GetConnectMetaFile();
- pOutDev->SetConnectMetaFile(NULL);
- // turn off output to the device
- pOutDev->EnableOutput(false);
- // just record the rendering commands to the metafile
- // instead
- pMetaFile = new GDIMetaFile;
- pMetaFile->Record(pOutDev);
- }
-
// Print/PDF export for (multi-)selection has already generated a
// temporary document with the selected text.
// (see XRenderable implementation in unotxdoc.cxx)
@@ -490,6 +470,8 @@ sal_Bool SwViewShell::PrintOrPDFExport(
pDrawView->SetBufferedOverlayAllowed( false );
}
+ sal_Int16 nPostItMode = rPrintData.GetPrintPostIts();
+
{ // additional scope so that the CurrShell is reset before destroying the shell
SET_CURR_SHELL( pShell );
@@ -537,22 +519,6 @@ sal_Bool SwViewShell::PrintOrPDFExport(
pPostItManager->CalcRects();
pPostItManager->LayoutPostIts();
pPostItManager->DrawNotesForPage(pOutDev, nPage-1);
-
- //Now scale the recorded page down so the notes
- //will fit in the final page
- pMetaFile->Stop();
- pMetaFile->WindStart();
- double fScale = 0.75;
- pMetaFile->Scale( fScale, fScale );
- pMetaFile->WindStart();
-
- //Enable output the the device again
- pOutDev->EnableOutput(true);
- //Restore the original recorder
- pOutDev->SetConnectMetaFile(pOrigRecorder);
- //play back the scaled page
- pMetaFile->Play(pOutDev);
- delete pMetaFile;
}
}
@@ -562,6 +528,24 @@ sal_Bool SwViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Pop();
+ // fdo#36815 for comments in margins get the metafile we are printing to
+ // and then scale and vertically center that metafile down so that the
+ // comments will fit on the real page
+ GDIMetaFile *pRecorder = pOutDev->GetConnectMetaFile();
+ if (nPostItMode == POSTITS_INMARGINS && pRecorder)
+ {
+ pRecorder->Stop();
+ pRecorder->WindStart();
+ double fScale = 0.75;
+ long nOrigHeight = pOutDev->GetOutputSize().Height();
+ long nNewHeight = nOrigHeight*fScale;
+ long nShiftY = (nOrigHeight-nNewHeight)/2;
+ pRecorder->Scale(fScale, fScale);
+ pRecorder->WindStart();
+ pRecorder->Move(0, nShiftY, pOutDev->ImplGetDPIX(), pOutDev->ImplGetDPIY());
+ pRecorder->WindStart();
+ }
+
return sal_True;
}
--
1.9.0

@ -0,0 +1,72 @@
From f756fb84a1629d455ccbd7af1f3975ac307fb957 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 24 Apr 2014 17:10:12 +0100
Subject: [PATCH] Resolves: fdo#60040 crash after undoing master page
application
regression since 839cb94a2bd9dfadb6a7e11a97f0540a78f79b6b
Change-Id: Ie7068ecd1655ecae169948dc1e08330dc4200bf9
---
sd/source/core/drawdoc3.cxx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index d423352..5621826 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1414,7 +1414,6 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
SdPage& rOldNotesMaster = (SdPage&)pNotes->TRG_GetMasterPage();
SdPage* pMaster = NULL;
SdPage* pNotesMaster = NULL;
- SdPage* pPage = NULL;
OUString aOldPageLayoutName(pSelectedPage->GetLayoutName());
OUString aOldLayoutName(aOldPageLayoutName);
sal_Int32 nIndex = aOldLayoutName.indexOf( SD_LT_SEPARATOR );
@@ -1714,7 +1713,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
- pPage = (SdPage*) GetPage(nPage);
+ SdPage* pPage = (SdPage*) GetPage(nPage);
OUString aTest = pPage->GetLayoutName();
if (aTest == aOldPageLayoutName)
{
@@ -1731,20 +1730,21 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
for (std::vector<SdPage*>::iterator pIter = aPageList.begin(); pIter != aPageList.end(); ++pIter)
{
- AutoLayout eAutoLayout = (*pIter)->GetAutoLayout();
+ SdPage* pPage = *pIter;
+ AutoLayout eAutoLayout = pPage->GetAutoLayout();
if( bUndo )
{
SdPresentationLayoutUndoAction * pPLUndoAction =
new SdPresentationLayoutUndoAction
(this,
- ( pPage && pPage->IsMasterPage() ) ? aLayoutName : aOldLayoutName,
+ pPage->IsMasterPage() ? aLayoutName : aOldLayoutName,
aLayoutName,
eAutoLayout, eAutoLayout, false, *pIter);
pUndoMgr->AddUndoAction(pPLUndoAction);
}
- (*pIter)->SetPresentationLayout(aLayoutName);
- (*pIter)->SetAutoLayout(eAutoLayout);
+ pPage->SetPresentationLayout(aLayoutName);
+ pPage->SetAutoLayout(eAutoLayout);
}
// Adapt new master pages
@@ -1847,7 +1847,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
- pPage = (SdPage*) GetPage(nPage);
+ SdPage* pPage = (SdPage*) GetPage(nPage);
if (pPage->GetLayoutName() == aOldPageLayoutName)
{
aPageList.push_back(pPage);
--
1.9.0

@ -0,0 +1,32 @@
From 29b969d29225400e9f8ace12ea2c1276541f9ead Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 24 Apr 2014 13:51:27 +0100
Subject: [PATCH] crash in selecting text in comments midway in para
(cherry picked from commit 7dca5341d799d59a81e6dac84586fa2daa02a550)
Conflicts:
sw/source/core/uibase/shells/langhelper.cxx
Change-Id: Iaab71e201fae6a03936ccc6aac040027a183209c
---
sw/source/ui/shells/langhelper.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index d3055a2..52ca770 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -573,7 +573,8 @@ namespace SwLangHelper
// string for guessing language
OUString aText;
- aText = rEditEngine->GetText(aDocSelection);
+ // get the full text of the paragraph that the end of selection is in
+ aText = rEditEngine->GetText(aDocSelection.nEndPos);
if (!aText.isEmpty())
{
xub_StrLen nStt = 0;
--
1.9.0

@ -302,6 +302,9 @@ Patch35: 0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch
Patch36: 0001-Resolves-rhbz-1089377-crash-on-loading-a-specific-rt.patch
Patch37: 0001-add-a-format-all-comments-feature.patch
Patch38: 0001-Resolves-fdo-37130-use-10pt-Default-style-font-for-c.patch
Patch39: 0001-Related-fdo-36815-center-scaled-comment-page-vertica.patch
Patch40: 0001-crash-in-selecting-text-in-comments-midway-in-para.patch
Patch41: 0001-Resolves-fdo-60040-crash-after-undoing-master-page-a.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@ -2293,8 +2296,10 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Wed Apr 23 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.2.4.1-6-UNBUILT
* Thu Apr 24 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.2.4.1-6
- Resolves: fdo#37130 use 10pt Default style font for comments
- Resolves: fdo#60040 crash after undoing master page
- vertically center printout when including comments
* Wed Apr 23 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.2.4.1-5
- add a 'format all comments' feature

Loading…
Cancel
Save