1 |
From fd3cf8a32c58ee1b0f9d676cfb393478cf9b1ba2 Mon Sep 17 00:00:00 2001 |
2 |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> |
3 |
Date: Tue, 15 Apr 2014 09:42:32 +0100 |
4 |
Subject: [PATCH] Resolves: fdo#36815 enable printing WYSIWYG sidewindow |
5 |
comments |
6 |
|
7 |
in order for that to happen the document has to be scaled down |
8 |
so that the comments outside the border of the sheet of paper |
9 |
can be brought inside the printable area |
10 |
|
11 |
Change-Id: Ifafb8eec10a4ea3ea0014097728888603e61e5a4 |
12 |
--- |
13 |
sw/inc/PostItMgr.hxx | 3 ++ |
14 |
sw/inc/SidebarWin.hxx | 1 + |
15 |
sw/inc/printdata.hxx | 1 + |
16 |
sw/source/core/layout/paintfrm.cxx | 2 +- |
17 |
sw/source/core/view/printdata.cxx | 7 ++-- |
18 |
sw/source/core/view/vprint.cxx | 49 ++++++++++++++++++++++++-- |
19 |
sw/source/ui/config/optdlg.src | 1 + |
20 |
sw/source/ui/config/optpage.cxx | 7 ++++ |
21 |
sw/source/ui/docvw/PostItMgr.cxx | 16 +++++++++ |
22 |
sw/source/ui/docvw/SidebarTxtControl.cxx | 40 ++++++++++++++++++++++ |
23 |
sw/source/ui/docvw/SidebarTxtControl.hxx | 2 ++ |
24 |
sw/source/ui/docvw/SidebarWin.cxx | 55 ++++++++++++++++++++++++++++++ |
25 |
sw/source/ui/inc/optpage.hxx | 1 + |
26 |
sw/uiconfig/swriter/ui/printoptionspage.ui | 23 +++++++++++-- |
27 |
14 files changed, 200 insertions(+), 8 deletions(-) |
28 |
|
29 |
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx |
30 |
index 4c38d40..0ac0273 100644 |
31 |
--- a/sw/inc/PostItMgr.hxx |
32 |
+++ b/sw/inc/PostItMgr.hxx |
33 |
@@ -33,6 +33,7 @@ |
34 |
#include <SidebarWindowsTypes.hxx> |
35 |
#include <svl/lstner.hxx> |
36 |
|
37 |
+class OutputDevice; |
38 |
class SwWrtShell; |
39 |
class SwDoc; |
40 |
class SwView; |
41 |
@@ -279,6 +280,8 @@ class SwPostItMgr: public SfxListener |
42 |
const sal_Int32 nIndex ); |
43 |
void GetAllSidebarWinForFrm( const SwFrm& rFrm, |
44 |
std::vector< Window* >* pChildren ); |
45 |
+ |
46 |
+ void DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage); |
47 |
}; |
48 |
|
49 |
#endif |
50 |
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx |
51 |
index b3c4c82..5c8c527 100644 |
52 |
--- a/sw/inc/SidebarWin.hxx |
53 |
+++ b/sw/inc/SidebarWin.hxx |
54 |
@@ -163,6 +163,7 @@ class SwSidebarWin : public Window |
55 |
|
56 |
void ChangeSidebarItem( SwSidebarItem& rSidebarItem ); |
57 |
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); |
58 |
+ virtual void Draw(OutputDevice* pDev, const Point&, const Size&, sal_uLong); |
59 |
|
60 |
protected: |
61 |
virtual void DataChanged( const DataChangedEvent& aEvent); |
62 |
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx |
63 |
index b688608..b2f49b7 100644 |
64 |
--- a/sw/inc/printdata.hxx |
65 |
+++ b/sw/inc/printdata.hxx |
66 |
@@ -307,6 +307,7 @@ public: |
67 |
#define POSTITS_ONLY 1 |
68 |
#define POSTITS_ENDDOC 2 |
69 |
#define POSTITS_ENDPAGE 3 |
70 |
+#define POSTITS_INMARGINS 4 |
71 |
|
72 |
namespace sw { |
73 |
|
74 |
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx |
75 |
index 3e4ed87..2e88ef7 100644 |
76 |
--- a/sw/source/core/layout/paintfrm.cxx |
77 |
+++ b/sw/source/core/layout/paintfrm.cxx |
78 |
@@ -6213,7 +6213,7 @@ static void lcl_paintBitmapExToRect(OutputDevice *pOut, Point aPoint, BitmapEx& |
79 |
SwAlignRect( aPageRect, _pViewShell ); |
80 |
|
81 |
const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr(); |
82 |
- if (pMgr && pMgr->ShowNotes() && pMgr->HasNotes()) // do not show anything in print preview |
83 |
+ if (pMgr /*&& pMgr->ShowNotes()*/ && pMgr->HasNotes()) // do not show anything in print preview |
84 |
{ |
85 |
sal_Int32 nScrollerHeight = pMgr->GetSidebarScrollerHeight(); |
86 |
const Rectangle &aVisRect = _pViewShell->VisArea().SVRect(); |
87 |
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx |
88 |
index 192ae5a..b2e2ef5 100644 |
89 |
--- a/sw/source/core/view/printdata.cxx |
90 |
+++ b/sw/source/core/view/printdata.cxx |
91 |
@@ -172,8 +172,8 @@ SwPrintUIOptions::SwPrintUIOptions( |
92 |
{ |
93 |
ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) ); |
94 |
|
95 |
- OSL_ENSURE( aLocalizedStrings.Count() >= 30, "resource incomplete" ); |
96 |
- if( aLocalizedStrings.Count() < 30 ) // bad resource ? |
97 |
+ OSL_ENSURE( aLocalizedStrings.Count() >= 31, "resource incomplete" ); |
98 |
+ if( aLocalizedStrings.Count() < 31 ) // bad resource ? |
99 |
return; |
100 |
|
101 |
// printing HTML sources does not have any valid UI options. |
102 |
@@ -322,11 +322,12 @@ SwPrintUIOptions::SwPrintUIOptions( |
103 |
OUString(), aContentsOpt); |
104 |
// create a list box for notes content |
105 |
const sal_Int16 nPrintPostIts = rDefaultPrintData.GetPrintPostIts(); |
106 |
- aChoices.realloc( 4 ); |
107 |
+ aChoices.realloc( 5 ); |
108 |
aChoices[0] = aLocalizedStrings.GetString( 13 ); |
109 |
aChoices[1] = aLocalizedStrings.GetString( 14 ); |
110 |
aChoices[2] = aLocalizedStrings.GetString( 15 ); |
111 |
aChoices[3] = aLocalizedStrings.GetString( 16 ); |
112 |
+ aChoices[4] = aLocalizedStrings.GetString( 30 ); |
113 |
aHelpIds.realloc( 2 ); |
114 |
aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText"; |
115 |
aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox"; |
116 |
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx |
117 |
index ff5ffb2..13c829b 100644 |
118 |
--- a/sw/source/core/view/vprint.cxx |
119 |
+++ b/sw/source/core/view/vprint.cxx |
120 |
@@ -69,6 +69,7 @@ |
121 |
#include <viscrs.hxx> |
122 |
#include <fmtpdsc.hxx> |
123 |
#include <globals.hrc> |
124 |
+#include "PostItMgr.hxx" |
125 |
|
126 |
using namespace ::com::sun::star; |
127 |
|
128 |
@@ -454,13 +455,33 @@ sal_Bool SwViewShell::PrintOrPDFExport( |
129 |
// output device is now provided by a call from outside the Writer) |
130 |
pOutDev->Push(); |
131 |
|
132 |
+ // fdo#36815 for comments in margins print to a metafile |
133 |
+ // and then scale that metafile down so that the comments |
134 |
+ // will fit on the real page, and replay that scaled |
135 |
+ // output to the real outputdevice |
136 |
+ GDIMetaFile *pOrigRecorder(NULL); |
137 |
+ GDIMetaFile *pMetaFile(NULL); |
138 |
+ sal_Int16 nPostItMode = rPrintData.GetPrintPostIts(); |
139 |
+ if (nPostItMode == POSTITS_INMARGINS) |
140 |
+ { |
141 |
+ //get and disable the existing recorder |
142 |
+ pOrigRecorder = pOutDev->GetConnectMetaFile(); |
143 |
+ pOutDev->SetConnectMetaFile(NULL); |
144 |
+ // turn off output to the device |
145 |
+ pOutDev->EnableOutput(false); |
146 |
+ // just record the rendering commands to the metafile |
147 |
+ // instead |
148 |
+ pMetaFile = new GDIMetaFile; |
149 |
+ pMetaFile->Record(pOutDev); |
150 |
+ } |
151 |
+ |
152 |
// Print/PDF export for (multi-)selection has already generated a |
153 |
// temporary document with the selected text. |
154 |
// (see XRenderable implementation in unotxdoc.cxx) |
155 |
// It is implemented this way because PDF export calls this Prt function |
156 |
// once per page and we do not like to always have the temporary document |
157 |
// to be created that often here. |
158 |
- SwViewShell *pShell = new SwViewShell( *this, 0, pOutDev ); |
159 |
+ SwViewShell *pShell = new SwViewShell(*this, 0, pOutDev); |
160 |
|
161 |
SdrView *pDrawView = pShell->GetDrawView(); |
162 |
if (pDrawView) |
163 |
@@ -502,13 +523,37 @@ sal_Bool SwViewShell::PrintOrPDFExport( |
164 |
|
165 |
::SetSwVisArea( pViewSh2, pStPage->Frm() ); |
166 |
|
167 |
- pShell->InitPrt( pOutDev ); |
168 |
+ pShell->InitPrt(pOutDev); |
169 |
|
170 |
::SetSwVisArea( pViewSh2, pStPage->Frm() ); |
171 |
|
172 |
pStPage->GetUpper()->Paint( pStPage->Frm(), &rPrintData ); |
173 |
|
174 |
SwPaintQueue::Repaint(); |
175 |
+ |
176 |
+ if (nPostItMode == POSTITS_INMARGINS) |
177 |
+ { |
178 |
+ SwPostItMgr *pPostItManager = pShell->GetPostItMgr(); |
179 |
+ pPostItManager->CalcRects(); |
180 |
+ pPostItManager->LayoutPostIts(); |
181 |
+ pPostItManager->DrawNotesForPage(pOutDev, nPage-1); |
182 |
+ |
183 |
+ //Now scale the recorded page down so the notes |
184 |
+ //will fit in the final page |
185 |
+ pMetaFile->Stop(); |
186 |
+ pMetaFile->WindStart(); |
187 |
+ double fScale = 0.75; |
188 |
+ pMetaFile->Scale( fScale, fScale ); |
189 |
+ pMetaFile->WindStart(); |
190 |
+ |
191 |
+ //Enable output the the device again |
192 |
+ pOutDev->EnableOutput(true); |
193 |
+ //Restore the original recorder |
194 |
+ pOutDev->SetConnectMetaFile(pOrigRecorder); |
195 |
+ //play back the scaled page |
196 |
+ pMetaFile->Play(pOutDev); |
197 |
+ delete pMetaFile; |
198 |
+ } |
199 |
} |
200 |
|
201 |
delete pShell; |
202 |
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src |
203 |
index 748560a..b5ae69c 100644 |
204 |
--- a/sw/source/ui/config/optdlg.src |
205 |
+++ b/sw/source/ui/config/optdlg.src |
206 |
@@ -71,6 +71,7 @@ StringArray STR_PRINTOPTUI |
207 |
< "~All pages"; >; |
208 |
< "Pa~ges"; >; |
209 |
< "~Selection"; >; |
210 |
+ < "Place in margins"; >; |
211 |
}; |
212 |
}; |
213 |
|
214 |
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx |
215 |
index d7efd53..4549402 100644 |
216 |
--- a/sw/source/ui/config/optpage.cxx |
217 |
+++ b/sw/source/ui/config/optpage.cxx |
218 |
@@ -312,6 +312,7 @@ SwAddPrinterTabPage::SwAddPrinterTabPage(Window* pParent, |
219 |
get(m_pOnlyRB, "only"); |
220 |
get(m_pEndRB, "end"); |
221 |
get(m_pEndPageRB, "endpage"); |
222 |
+ get(m_pInMarginsRB, "inmargins"); |
223 |
get(m_pPrintEmptyPagesCB, "blankpages"); |
224 |
get(m_pPaperFromSetupCB, "papertray"); |
225 |
get(m_pFaxLB, "fax"); |
226 |
@@ -332,6 +333,7 @@ SwAddPrinterTabPage::SwAddPrinterTabPage(Window* pParent, |
227 |
m_pPaperFromSetupCB->SetClickHdl( aLk ); |
228 |
m_pPrintEmptyPagesCB->SetClickHdl( aLk ); |
229 |
m_pEndPageRB->SetClickHdl( aLk ); |
230 |
+ m_pInMarginsRB->SetClickHdl( aLk ); |
231 |
m_pEndRB->SetClickHdl( aLk ); |
232 |
m_pOnlyRB->SetClickHdl( aLk ); |
233 |
m_pNoRB->SetClickHdl( aLk ); |
234 |
@@ -398,6 +400,8 @@ sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet ) |
235 |
POSTITS_ENDDOC; |
236 |
if (m_pEndPageRB->IsChecked()) aAddPrinterAttr.nPrintPostIts = |
237 |
POSTITS_ENDPAGE; |
238 |
+ if (m_pInMarginsRB->IsChecked()) aAddPrinterAttr.nPrintPostIts = |
239 |
+ POSTITS_INMARGINS; |
240 |
|
241 |
OUString sFax = m_pFaxLB->GetSelectEntry(); |
242 |
aAddPrinterAttr.sFaxName = sNone == sFax ? aEmptyOUStr : sFax; |
243 |
@@ -431,6 +435,7 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) |
244 |
m_pOnlyRB->Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ONLY ) ; |
245 |
m_pEndRB->Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ENDDOC ) ; |
246 |
m_pEndPageRB->Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ENDPAGE ) ; |
247 |
+ m_pInMarginsRB->Check (pAddPrinterAttr->nPrintPostIts== POSTITS_INMARGINS ) ; |
248 |
m_pFaxLB->SelectEntry( pAddPrinterAttr->sFaxName ); |
249 |
} |
250 |
if (m_pProspectCB->IsChecked()) |
251 |
@@ -440,6 +445,7 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) |
252 |
m_pOnlyRB->Enable( sal_False ); |
253 |
m_pEndRB->Enable( sal_False ); |
254 |
m_pEndPageRB->Enable( sal_False ); |
255 |
+ m_pInMarginsRB->Enable( sal_False ); |
256 |
} |
257 |
else |
258 |
m_pProspectCB_RTL->Enable( sal_False ); |
259 |
@@ -461,6 +467,7 @@ IMPL_LINK_NOARG_INLINE_START(SwAddPrinterTabPage, AutoClickHdl) |
260 |
m_pOnlyRB->Enable( !bIsProspect ); |
261 |
m_pEndRB->Enable( !bIsProspect ); |
262 |
m_pEndPageRB->Enable( !bIsProspect ); |
263 |
+ m_pInMarginsRB->Enable( !bIsProspect ); |
264 |
return 0; |
265 |
} |
266 |
IMPL_LINK_NOARG_INLINE_END(SwAddPrinterTabPage, AutoClickHdl) |
267 |
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx |
268 |
index 8ca06e7..e6b7cb6 100644 |
269 |
--- a/sw/source/ui/docvw/PostItMgr.cxx |
270 |
+++ b/sw/source/ui/docvw/PostItMgr.cxx |
271 |
@@ -807,6 +807,22 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const |
272 |
return false; |
273 |
} |
274 |
|
275 |
+void SwPostItMgr::DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage) |
276 |
+{ |
277 |
+ assert(nPage < mPages.size()); |
278 |
+ if (nPage >= mPages.size()) |
279 |
+ return; |
280 |
+ for(SwSidebarItem_iterator i = mPages[nPage]->mList->begin(); i != mPages[nPage]->mList->end(); ++i) |
281 |
+ { |
282 |
+ SwSidebarWin* pPostIt = (*i)->pPostIt; |
283 |
+ if (!pPostIt) |
284 |
+ continue; |
285 |
+ Point aPoint(mpEditWin->PixelToLogic(pPostIt->GetPosPixel())); |
286 |
+ Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel())); |
287 |
+ pPostIt->Draw(pOutDev, aPoint, aSize, 0); |
288 |
+ } |
289 |
+} |
290 |
+ |
291 |
void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) |
292 |
{ |
293 |
OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); |
294 |
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx |
295 |
index b1d3767..15af740 100644 |
296 |
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx |
297 |
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx |
298 |
@@ -118,6 +118,46 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt) |
299 |
} |
300 |
} |
301 |
|
302 |
+void SidebarTxtControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong) |
303 |
+{ |
304 |
+ if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) |
305 |
+ { |
306 |
+ if ( mrSidebarWin.IsMouseOverSidebarWin() || |
307 |
+ HasFocus() ) |
308 |
+ { |
309 |
+ pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ), |
310 |
+ Gradient( GradientStyle_LINEAR, |
311 |
+ mrSidebarWin.ColorDark(), |
312 |
+ mrSidebarWin.ColorDark() ) ); |
313 |
+ } |
314 |
+ else |
315 |
+ { |
316 |
+ pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ), |
317 |
+ Gradient( GradientStyle_LINEAR, |
318 |
+ mrSidebarWin.ColorLight(), |
319 |
+ mrSidebarWin.ColorDark())); |
320 |
+ } |
321 |
+ } |
322 |
+ |
323 |
+ if ( GetTextView() ) |
324 |
+ { |
325 |
+ GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, rSz)); |
326 |
+ } |
327 |
+ |
328 |
+ if ( mrSidebarWin.GetLayoutStatus()==SwPostItHelper::DELETED ) |
329 |
+ { |
330 |
+ SetLineColor(mrSidebarWin.GetChangeColor()); |
331 |
+ pDev->DrawLine( PixelToLogic( GetPosPixel(), pDev->GetMapMode() ), |
332 |
+ PixelToLogic( GetPosPixel() + |
333 |
+ Point( GetSizePixel().Width(), |
334 |
+ GetSizePixel().Height() ), pDev->GetMapMode() ) ); |
335 |
+ pDev->DrawLine( PixelToLogic( GetPosPixel() + |
336 |
+ Point( GetSizePixel().Width(),0), pDev->GetMapMode() ), |
337 |
+ PixelToLogic( GetPosPixel() + |
338 |
+ Point( 0, GetSizePixel().Height() ), pDev->GetMapMode() ) ); |
339 |
+ } |
340 |
+} |
341 |
+ |
342 |
void SidebarTxtControl::Paint( const Rectangle& rRect) |
343 |
{ |
344 |
if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) |
345 |
diff --git a/sw/source/ui/docvw/SidebarTxtControl.hxx b/sw/source/ui/docvw/SidebarTxtControl.hxx |
346 |
index 37829b2..66e282f 100644 |
347 |
--- a/sw/source/ui/docvw/SidebarTxtControl.hxx |
348 |
+++ b/sw/source/ui/docvw/SidebarTxtControl.hxx |
349 |
@@ -66,6 +66,8 @@ class SidebarTxtControl : public Control |
350 |
DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*); |
351 |
|
352 |
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); |
353 |
+ virtual void Draw(OutputDevice* pDev, const Point&, const Size&, sal_uLong); |
354 |
+ |
355 |
}; |
356 |
|
357 |
} } // end of namespace sw::sidebarwindows |
358 |
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx |
359 |
index 4cf128a..275b72e 100644 |
360 |
--- a/sw/source/ui/docvw/SidebarWin.cxx |
361 |
+++ b/sw/source/ui/docvw/SidebarWin.cxx |
362 |
@@ -64,10 +64,12 @@ |
363 |
#include <langhelper.hxx> |
364 |
|
365 |
#include <sw_primitivetypes2d.hxx> |
366 |
+#include <drawinglayer/processor2d/baseprocessor2d.hxx> |
367 |
#include <drawinglayer/primitive2d/primitivetools2d.hxx> |
368 |
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx> |
369 |
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> |
370 |
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> |
371 |
+#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> |
372 |
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx> |
373 |
|
374 |
namespace sw { namespace sidebarwindows { |
375 |
@@ -212,6 +214,59 @@ void SwSidebarWin::Paint( const Rectangle& rRect) |
376 |
} |
377 |
} |
378 |
|
379 |
+void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong nInFlags) |
380 |
+{ |
381 |
+ if (mpMetadataAuthor->IsVisible() ) |
382 |
+ { |
383 |
+ //draw left over space |
384 |
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) |
385 |
+ { |
386 |
+ pDev->SetFillColor(COL_BLACK); |
387 |
+ } |
388 |
+ else |
389 |
+ { |
390 |
+ pDev->SetFillColor(mColorDark); |
391 |
+ } |
392 |
+ pDev->SetLineColor(); |
393 |
+ pDev->DrawRect( Rectangle( rPt, rSz ) ); |
394 |
+ } |
395 |
+ |
396 |
+ if (mpMetadataAuthor->IsVisible()) |
397 |
+ { |
398 |
+ Font aOrigFont(mpMetadataAuthor->GetControlFont()); |
399 |
+ Size aSize(PixelToLogic(mpMetadataAuthor->GetSizePixel())); |
400 |
+ Point aPos(PixelToLogic(mpMetadataAuthor->GetPosPixel())); |
401 |
+ aPos += rPt; |
402 |
+ Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() ); |
403 |
+ mpMetadataAuthor->SetControlFont( aFont ); |
404 |
+ mpMetadataAuthor->Draw(pDev, aPos, aSize, nInFlags); |
405 |
+ mpMetadataAuthor->SetControlFont( aOrigFont ); |
406 |
+ } |
407 |
+ |
408 |
+ if (mpMetadataDate->IsVisible()) |
409 |
+ { |
410 |
+ Font aOrigFont(mpMetadataDate->GetControlFont()); |
411 |
+ Size aSize(PixelToLogic(mpMetadataDate->GetSizePixel())); |
412 |
+ Point aPos(PixelToLogic(mpMetadataDate->GetPosPixel())); |
413 |
+ aPos += rPt; |
414 |
+ Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() ); |
415 |
+ mpMetadataDate->SetControlFont( aFont ); |
416 |
+ mpMetadataDate->Draw(pDev, aPos, aSize, nInFlags); |
417 |
+ mpMetadataDate->SetControlFont( aOrigFont ); |
418 |
+ } |
419 |
+ |
420 |
+ mpSidebarTxtControl->Draw(pDev, rPt, rSz, nInFlags); |
421 |
+ |
422 |
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence = mpAnchor->getOverlayObjectPrimitive2DSequence(); |
423 |
+ const drawinglayer::geometry::ViewInformation2D aNewViewInfos; |
424 |
+ drawinglayer::processor2d::BaseProcessor2D * pProcessor = |
425 |
+ drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice( |
426 |
+ *pDev, aNewViewInfos ); |
427 |
+ |
428 |
+ pProcessor->process(rSequence); |
429 |
+ delete pProcessor; |
430 |
+} |
431 |
+ |
432 |
void SwSidebarWin::SetPosSizePixelRect( long nX, |
433 |
long nY, |
434 |
long nWidth, |
435 |
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx |
436 |
index 3e196e2..fa8f6b7 100644 |
437 |
--- a/sw/source/ui/inc/optpage.hxx |
438 |
+++ b/sw/source/ui/inc/optpage.hxx |
439 |
@@ -104,6 +104,7 @@ class SwAddPrinterTabPage : public SfxTabPage |
440 |
RadioButton* m_pOnlyRB; |
441 |
RadioButton* m_pEndRB; |
442 |
RadioButton* m_pEndPageRB; |
443 |
+ RadioButton* m_pInMarginsRB; |
444 |
|
445 |
CheckBox* m_pPrintEmptyPagesCB; |
446 |
CheckBox* m_pPaperFromSetupCB; |
447 |
diff --git a/sw/uiconfig/swriter/ui/printoptionspage.ui b/sw/uiconfig/swriter/ui/printoptionspage.ui |
448 |
index 0bf9afe..95e5ae2 100644 |
449 |
--- a/sw/uiconfig/swriter/ui/printoptionspage.ui |
450 |
+++ b/sw/uiconfig/swriter/ui/printoptionspage.ui |
451 |
@@ -1,6 +1,7 @@ |
452 |
<?xml version="1.0" encoding="UTF-8"?> |
453 |
+<!-- Generated with glade 3.16.1 --> |
454 |
<interface> |
455 |
- <!-- interface-requires gtk+ 3.0 --> |
456 |
+ <requires lib="gtk+" version="3.0"/> |
457 |
<object class="GtkBox" id="PrintOptionsPage"> |
458 |
<property name="visible">True</property> |
459 |
<property name="can_focus">False</property> |
460 |
@@ -344,7 +345,7 @@ |
461 |
<property name="use_underline">True</property> |
462 |
<property name="xalign">0</property> |
463 |
<property name="draw_indicator">True</property> |
464 |
- <property name="group">none</property> |
465 |
+ <property name="group">inmargins</property> |
466 |
</object> |
467 |
<packing> |
468 |
<property name="left_attach">0</property> |
469 |
@@ -353,6 +354,24 @@ |
470 |
<property name="height">1</property> |
471 |
</packing> |
472 |
</child> |
473 |
+ <child> |
474 |
+ <object class="GtkRadioButton" id="inmargins"> |
475 |
+ <property name="label" translatable="yes">In margins</property> |
476 |
+ <property name="visible">True</property> |
477 |
+ <property name="can_focus">True</property> |
478 |
+ <property name="receives_default">False</property> |
479 |
+ <property name="use_underline">True</property> |
480 |
+ <property name="xalign">0</property> |
481 |
+ <property name="draw_indicator">True</property> |
482 |
+ <property name="group">none</property> |
483 |
+ </object> |
484 |
+ <packing> |
485 |
+ <property name="left_attach">0</property> |
486 |
+ <property name="top_attach">4</property> |
487 |
+ <property name="width">1</property> |
488 |
+ <property name="height">1</property> |
489 |
+ </packing> |
490 |
+ </child> |
491 |
</object> |
492 |
</child> |
493 |
</object> |
494 |
-- |
495 |
1.8.5.3 |
496 |
|