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
b0edaff7
Kaydet (Commit)
b0edaff7
authored
Nis 11, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#44176 dmapper: fix import of titlepg top/bottom margin
üst
dd9bbad2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
fdo44176.rtf
sw/qa/extras/rtftok/data/fdo44176.rtf
+10
-0
rtftok.cxx
sw/qa/extras/rtftok/rtftok.cxx
+18
-0
PropertyMap.cxx
writerfilter/source/dmapper/PropertyMap.cxx
+12
-3
No files found.
sw/qa/extras/rtftok/data/fdo44176.rtf
0 → 100644
Dosyayı görüntüle @
b0edaff7
{\rtf1
{\header foo
\par }
\titlepg
First page has no header.
\par
\pagebb
Second page has a header.
\par
}
sw/qa/extras/rtftok/rtftok.cxx
Dosyayı görüntüle @
b0edaff7
...
...
@@ -79,6 +79,7 @@ public:
void
testFdo48104
();
void
testFdo47107
();
void
testFdo45182
();
void
testFdo44176
();
CPPUNIT_TEST_SUITE
(
RtfModelTest
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -100,6 +101,7 @@ public:
CPPUNIT_TEST
(
testFdo48104
);
CPPUNIT_TEST
(
testFdo47107
);
CPPUNIT_TEST
(
testFdo45182
);
CPPUNIT_TEST
(
testFdo44176
);
#endif
CPPUNIT_TEST_SUITE_END
();
...
...
@@ -515,6 +517,22 @@ void RtfModelTest::testFdo45182()
CPPUNIT_ASSERT_EQUAL
(
aExpected
,
xTextRange
->
getString
());
}
void
RtfModelTest
::
testFdo44176
()
{
load
(
"fdo44176.rtf"
);
uno
::
Reference
<
style
::
XStyleFamiliesSupplier
>
xStyleFamiliesSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XNameAccess
>
xStyles
(
xStyleFamiliesSupplier
->
getStyleFamilies
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XNameAccess
>
xPageStyles
(
xStyles
->
getByName
(
"PageStyles"
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
xFirstPage
(
xPageStyles
->
getByName
(
"First Page"
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
xDefault
(
xPageStyles
->
getByName
(
"Default"
),
uno
::
UNO_QUERY
);
sal_Int32
nFirstTop
=
0
,
nDefaultTop
=
0
,
nDefaultHeader
=
0
;
xFirstPage
->
getPropertyValue
(
"TopMargin"
)
>>=
nFirstTop
;
xDefault
->
getPropertyValue
(
"TopMargin"
)
>>=
nDefaultTop
;
xDefault
->
getPropertyValue
(
"HeaderHeight"
)
>>=
nDefaultHeader
;
CPPUNIT_ASSERT_EQUAL
(
nFirstTop
,
nDefaultTop
+
nDefaultHeader
);
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
RtfModelTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
writerfilter/source/dmapper/PropertyMap.cxx
Dosyayı görüntüle @
b0edaff7
...
...
@@ -778,9 +778,18 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
operator
[](
PropertyDefinition
(
PROP_FOOTER_BODY_DISTANCE
,
false
))
=
uno
::
makeAny
(
m_nHeaderBottom
);
}
//now set the top/bottom margin for the follow page style
operator
[](
PropertyDefinition
(
PROP_TOP_MARGIN
,
false
))
=
uno
::
makeAny
(
m_nTopMargin
);
operator
[](
PropertyDefinition
(
PROP_BOTTOM_MARGIN
,
false
))
=
uno
::
makeAny
(
m_nBottomMargin
);
//now set the top/bottom margin
sal_Int32
nHeaderHeight
=
0
,
nFooterHeight
=
0
;
if
(
bFirstPage
)
{
// make sure the height of the header/footer is added to the top/bottom margin if necessary
if
(
m_aFollowPageStyle
.
is
()
&&
!
HasHeader
(
true
)
&&
HasHeader
(
false
))
m_aFollowPageStyle
->
getPropertyValue
(
"HeaderHeight"
)
>>=
nHeaderHeight
;
if
(
m_aFollowPageStyle
.
is
()
&&
!
HasFooter
(
true
)
&&
HasFooter
(
false
))
m_aFollowPageStyle
->
getPropertyValue
(
"FooterHeight"
)
>>=
nFooterHeight
;
}
operator
[](
PropertyDefinition
(
PROP_TOP_MARGIN
,
false
))
=
uno
::
makeAny
(
m_nTopMargin
+
nHeaderHeight
);
operator
[](
PropertyDefinition
(
PROP_BOTTOM_MARGIN
,
false
))
=
uno
::
makeAny
(
m_nBottomMargin
+
nFooterHeight
);
}
...
...
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