Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
af8a4cf2
Kaydet (Commit)
af8a4cf2
authored
Ara 11, 2009
tarafından
Thomas Lange [tl]
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i106926# fixing view settings after rendering
üst
466a6474
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
47 deletions
+56
-47
printdata.hxx
sw/inc/printdata.hxx
+2
-1
unotxdoc.hxx
sw/inc/unotxdoc.hxx
+5
-3
vprint.cxx
sw/source/core/view/vprint.cxx
+9
-3
unotxdoc.cxx
sw/source/ui/uno/unotxdoc.cxx
+40
-40
No files found.
sw/inc/printdata.hxx
Dosyayı görüntüle @
af8a4cf2
...
...
@@ -267,7 +267,8 @@ public:
void
DeletePostItData
();
bool
IsViewOptionAdjust
()
const
{
return
m_pViewOptionAdjust
!=
0
;
}
void
ViewOptionAdjustStart
(
SwWrtShell
&
rSh
,
const
SwPrtOptions
*
pPrtOptions
);
void
ViewOptionAdjustStart
(
SwWrtShell
&
rSh
,
const
SwViewOption
&
rViewOptions
);
void
ViewOptionAdjust
(
const
SwPrtOptions
*
pPrtOptions
);
void
ViewOptionAdjustStop
();
bool
HasSwPrtOptions
()
const
{
return
m_pPrtOptions
!=
0
;
}
...
...
sw/inc/unotxdoc.hxx
Dosyayı görüntüle @
af8a4cf2
...
...
@@ -602,12 +602,14 @@ class SwViewOptionAdjust_Impl
{
SwWrtShell
&
m_rShell
;
SwViewOption
m_aOldViewOptions
;
SwViewOption
m_aRenderViewOptions
;
// view options to use when rendering for PDF export or printing
bool
m_bRestoreViewOptions
;
//
SwViewOption m_aRenderViewOptions; // view options to use when rendering for PDF export or printing
//
bool m_bRestoreViewOptions;
public
:
SwViewOptionAdjust_Impl
(
SwWrtShell
&
rSh
,
const
Sw
PrtOptions
*
pPrt
Options
);
SwViewOptionAdjust_Impl
(
SwWrtShell
&
rSh
,
const
Sw
ViewOption
&
rView
Options
);
~
SwViewOptionAdjust_Impl
();
void
AdjustViewOptions
(
const
SwPrtOptions
*
pPrtOptions
);
};
sw/source/core/view/vprint.cxx
Dosyayı görüntüle @
af8a4cf2
...
...
@@ -282,13 +282,19 @@ void SwRenderData::DeletePostItData()
}
void
SwRenderData
::
ViewOptionAdjustStart
(
SwWrtShell
&
rSh
,
const
SwPrtOptions
*
pPrt
Options
)
void
SwRenderData
::
ViewOptionAdjustStart
(
SwWrtShell
&
rSh
,
const
SwViewOption
&
rView
Options
)
{
if
(
m_pViewOptionAdjust
)
{
DBG_ASSERT
(
0
,
"error: there should be no ViewOptionAdjust
Start active when calling it agai
n"
);
DBG_ASSERT
(
0
,
"error: there should be no ViewOptionAdjust
active when calling this functio
n"
);
}
m_pViewOptionAdjust
=
new
SwViewOptionAdjust_Impl
(
rSh
,
pPrtOptions
);
m_pViewOptionAdjust
=
new
SwViewOptionAdjust_Impl
(
rSh
,
rViewOptions
);
}
void
SwRenderData
::
ViewOptionAdjust
(
const
SwPrtOptions
*
pPrtOptions
)
{
m_pViewOptionAdjust
->
AdjustViewOptions
(
pPrtOptions
);
}
...
...
sw/source/ui/uno/unotxdoc.cxx
Dosyayı görüntüle @
af8a4cf2
...
...
@@ -2723,10 +2723,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
const
TypeId
aSwViewTypeId
=
TYPE
(
SwView
);
if
(
pView
->
IsA
(
aSwViewTypeId
))
{
// if there already is a not stopped view options adjustment we should return to
// the original values before calculating the new ones.
if
(
m_pRenderData
->
IsViewOptionAdjust
())
m_pRenderData
->
ViewOptionAdjustStop
();
if
(
m_pRenderData
&&
!
m_pRenderData
->
IsViewOptionAdjust
())
m_pRenderData
->
ViewOptionAdjustStart
(
*
pWrtShell
,
*
pWrtShell
->
GetViewOptions
()
);
}
m_pRenderData
->
SetSwPrtOptions
(
new
SwPrtOptions
(
C2U
(
bIsPDFExport
?
"PDF export"
:
"Printing"
)
)
);
...
...
@@ -2737,7 +2735,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
{
// PDF export should not make use of the SwPrtOptions
const
SwPrtOptions
*
pPrtOptions
=
bIsPDFExport
?
NULL
:
m_pRenderData
->
GetSwPrtOptions
();
m_pRenderData
->
ViewOptionAdjust
Start
(
*
((
SwView
*
)
pView
)
->
GetWrtShellPtr
(),
pPrtOptions
);
m_pRenderData
->
ViewOptionAdjust
(
pPrtOptions
);
}
// since printing now also use the API for PDF export this option
...
...
@@ -3078,7 +3076,7 @@ void SAL_CALL SwXTextDocument::render(
// -> do clean-up of data
if
(
bLastPage
)
{
// #i96167# haggai: delete
p
ViewOptionsAdjust here because it makes use
// #i96167# haggai: delete ViewOptionsAdjust here because it makes use
// of the shell, which might get destroyed in lcl_DisposeView!
if
(
m_pRenderData
&&
m_pRenderData
->
IsViewOptionAdjust
())
m_pRenderData
->
ViewOptionAdjustStop
();
...
...
@@ -4061,12 +4059,21 @@ void SwXDocumentPropertyHelper::onChange()
/*****************************************************************************/
SwViewOptionAdjust_Impl
::
SwViewOptionAdjust_Impl
(
SwWrtShell
&
rSh
,
const
SwPrtOptions
*
pPrtOptions
)
:
m_rShell
(
rSh
),
m_aOldViewOptions
(
*
rSh
.
GetViewOptions
()
),
m_bRestoreViewOptions
(
false
)
SwViewOptionAdjust_Impl
::
SwViewOptionAdjust_Impl
(
SwWrtShell
&
rSh
,
const
SwViewOption
&
rViewOptions
)
:
m_rShell
(
rSh
),
m_aOldViewOptions
(
rViewOptions
)
{
}
SwViewOptionAdjust_Impl
::~
SwViewOptionAdjust_Impl
()
{
m_rShell
.
ApplyViewOptions
(
m_aOldViewOptions
);
}
void
SwViewOptionAdjust_Impl
::
AdjustViewOptions
(
const
SwPrtOptions
*
pPrtOptions
)
{
// to avoid unnecessary reformatting the view options related to the content
// below should only change if necessary, that is if respective content is present
...
...
@@ -4079,56 +4086,49 @@ SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl(
const
bool
bContainsPlaceHolders
=
pFldType
&&
pFldType
->
GetDepends
();
const
bool
bContainsFields
=
m_rShell
.
IsAnyFieldInDoc
();
SwViewOption
aRenderViewOptions
(
m_aOldViewOptions
);
// disable anything in the view that should not be printed (or exported to PDF) by default
// (see also dialog "Tools/Options - StarOffice Writer - Formatting Aids"
// in section "Display of ...")
m_aRenderViewOptions
=
m_aOldViewOptions
;
m_aRenderViewOptions
.
SetParagraph
(
FALSE
);
// paragraph end
m_aRenderViewOptions
.
SetSoftHyph
(
FALSE
);
// aka custom hyphens
m_aRenderViewOptions
.
SetBlank
(
FALSE
);
// spaces
m_aRenderViewOptions
.
SetHardBlank
(
FALSE
);
// non-breaking spaces
m_aRenderViewOptions
.
SetTab
(
FALSE
);
// tabs
m_aRenderViewOptions
.
SetLineBreak
(
FALSE
);
// breaks (type 1)
m_aRenderViewOptions
.
SetPageBreak
(
FALSE
);
// breaks (type 2)
m_aRenderViewOptions
.
SetColumnBreak
(
FALSE
);
// breaks (type 3)
aRenderViewOptions
.
SetParagraph
(
FALSE
);
// paragraph end
aRenderViewOptions
.
SetSoftHyph
(
FALSE
);
// aka custom hyphens
aRenderViewOptions
.
SetBlank
(
FALSE
);
// spaces
aRenderViewOptions
.
SetHardBlank
(
FALSE
);
// non-breaking spaces
aRenderViewOptions
.
SetTab
(
FALSE
);
// tabs
aRenderViewOptions
.
SetLineBreak
(
FALSE
);
// breaks (type 1)
aRenderViewOptions
.
SetPageBreak
(
FALSE
);
// breaks (type 2)
aRenderViewOptions
.
SetColumnBreak
(
FALSE
);
// breaks (type 3)
BOOL
bVal
=
pPrtOptions
?
pPrtOptions
->
bPrintHiddenText
:
FALSE
;
if
(
bContainsHiddenChars
)
m_
aRenderViewOptions
.
SetShowHiddenChar
(
bVal
);
// hidden text
aRenderViewOptions
.
SetShowHiddenChar
(
bVal
);
// hidden text
if
(
bContainsHiddenFields
)
m_
aRenderViewOptions
.
SetShowHiddenField
(
bVal
);
aRenderViewOptions
.
SetShowHiddenField
(
bVal
);
if
(
bContainsHiddenParagraphs
)
m_
aRenderViewOptions
.
SetShowHiddenPara
(
bVal
);
aRenderViewOptions
.
SetShowHiddenPara
(
bVal
);
if
(
bContainsPlaceHolders
)
{
// should always be printed in PDF export!
bVal
=
pPrtOptions
?
pPrtOptions
->
bPrintTextPlaceholder
:
TRUE
;
m_
aRenderViewOptions
.
SetShowPlaceHolderFields
(
bVal
);
aRenderViewOptions
.
SetShowPlaceHolderFields
(
bVal
);
}
if
(
bContainsFields
)
m_
aRenderViewOptions
.
SetFldName
(
FALSE
);
aRenderViewOptions
.
SetFldName
(
FALSE
);
// we
don't want to print those.
//
Also this flag has effect on printing of other content e.g. hidden text
m_aRenderViewOptions
.
SetViewMetaChars
(
FALS
E
);
// we
need to set this flag in order to get to see the visible effect of
//
some of the above settings (needed for correct rendering)
aRenderViewOptions
.
SetViewMetaChars
(
TRU
E
);
if
(
m_aOldViewOptions
!=
m_
aRenderViewOptions
)
// check if reformatting is necessary
if
(
m_aOldViewOptions
!=
aRenderViewOptions
)
// check if reformatting is necessary
{
m_aRenderViewOptions
.
SetPrinting
(
pPrtOptions
!=
NULL
);
m_bRestoreViewOptions
=
true
;
SW_MOD
()
->
ApplyUsrPref
(
m_aRenderViewOptions
,
&
m_rShell
.
GetView
(),
VIEWOPT_DEST_VIEW_ONLY
);
aRenderViewOptions
.
SetPrinting
(
pPrtOptions
!=
NULL
);
m_rShell
.
ApplyViewOptions
(
aRenderViewOptions
);
}
}
SwViewOptionAdjust_Impl
::~
SwViewOptionAdjust_Impl
()
{
if
(
m_bRestoreViewOptions
)
SW_MOD
()
->
ApplyUsrPref
(
m_aOldViewOptions
,
&
m_rShell
.
GetView
(),
VIEWOPT_DEST_VIEW_ONLY
);
}
/*****************************************************************************/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment