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
b40fe8e5
Kaydet (Commit)
b40fe8e5
authored
May 21, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bnc#818997 RTF import: don't ignore page breaks between shapes
Change-Id: Ief71ba9a3c60356714e73d08e88d0a3105b17b1a
üst
2304089b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
0 deletions
+120
-0
n818997.rtf
sw/qa/extras/rtfimport/data/n818997.rtf
+77
-0
rtfimport.cxx
sw/qa/extras/rtfimport/rtfimport.cxx
+8
-0
DomainMapper.cxx
writerfilter/source/dmapper/DomainMapper.cxx
+13
-0
DomainMapper_Impl.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
+15
-0
DomainMapper_Impl.hxx
writerfilter/source/dmapper/DomainMapper_Impl.hxx
+1
-0
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+4
-0
rtfdocumentimpl.hxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
+2
-0
No files found.
sw/qa/extras/rtfimport/data/n818997.rtf
0 → 100644
Dosyayı görüntüle @
b40fe8e5
{\rtf
{\shp
{\*\shpinst\shpleft2310\shpright6060\shptop8685\shpbottom8985\shpbxpage
\shpbypage\shpwr3\shpz2
{\sp
{\sn shapeType}
{\sv 202}
}
{\sp
{\sn dxTextLeft}
{\sv
0}
}
{\sp
{\sn dxTextRight}
{\sv 0}
}
{\sp
{\sn dyTextTop}
{\sv 0}
}
{\sp
{\sn
dyTextBottom}
{\sv 0}
}
{\sp
{\sn fLine}
{\sv 0}
}
{\shptxt\plain\pard\f29\fs24
On first page.\par}
{\sp
{\sn fFilled}
{\sv 0}
}
}
}
\page
{\shp
{\*\shpinst\shpleft4800\shpright8025\shptop780\shpbottom1080\shpbxpage
\shpbypage\shpwr3\shpz2
{\sp
{\sn shapeType}
{\sv 202}
}
{\sp
{\sn dxTextLeft}
{\sv
0}
}
{\sp
{\sn dxTextRight}
{\sv 0}
}
{\sp
{\sn dyTextTop}
{\sv 0}
}
{\sp
{\sn
dyTextBottom}
{\sv 0}
}
{\sp
{\sn fLine}
{\sv 0}
}
{\shptxt\plain\pard\f29\fs24\b
On second page.\par}
{\sp
{\sn fFilled}
{\sv 0}
}
}
}
}
sw/qa/extras/rtfimport/rtfimport.cxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -135,6 +135,7 @@ public:
void
testFdo63023
();
void
testFdo42109
();
void
testFdo62977
();
void
testN818997
();
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -259,6 +260,7 @@ void Test::run()
{
"fdo63023.rtf"
,
&
Test
::
testFdo63023
},
{
"fdo42109.rtf"
,
&
Test
::
testFdo42109
},
{
"fdo62977.rtf"
,
&
Test
::
testFdo62977
},
{
"n818997.rtf"
,
&
Test
::
testN818997
},
};
header
();
for
(
unsigned
int
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aMethods
);
++
i
)
...
...
@@ -1232,6 +1234,12 @@ void Test::testFdo62977()
getRun
(
getParagraph
(
1
),
1
,
OUString
(
"
\xE5\xB9\xB4\xEF\xBC\x94\xE6\x9C\x88
"
,
9
,
RTL_TEXTENCODING_UTF8
));
}
void
Test
::
testN818997
()
{
// \page was ignored between two \shp tokens.
CPPUNIT_ASSERT_EQUAL
(
2
,
getPages
());
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
writerfilter/source/dmapper/DomainMapper.cxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -3486,6 +3486,19 @@ void DomainMapper::lcl_startShape( uno::Reference< drawing::XShape > xShape )
{
if
(
m_pImpl
->
GetTopContext
())
{
// If there is a deferred page break, handle it now, so that the
// started shape will be on the correct page.
if
(
m_pImpl
->
isBreakDeferred
(
PAGE_BREAK
))
{
m_pImpl
->
clearDeferredBreak
(
PAGE_BREAK
);
lcl_startCharacterGroup
();
sal_uInt8
sBreak
[]
=
{
0xd
};
lcl_text
(
sBreak
,
1
);
lcl_endCharacterGroup
();
lcl_endParagraphGroup
();
lcl_startParagraphGroup
();
m_pImpl
->
GetTopContext
()
->
Insert
(
PROP_BREAK_TYPE
,
true
,
uno
::
makeAny
(
com
::
sun
::
star
::
style
::
BreakType_PAGE_BEFORE
));
}
m_pImpl
->
PushShapeContext
(
xShape
);
lcl_startParagraphGroup
();
}
...
...
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -644,6 +644,21 @@ bool DomainMapper_Impl::isBreakDeferred( BreakType deferredBreakType )
}
}
void
DomainMapper_Impl
::
clearDeferredBreak
(
BreakType
deferredBreakType
)
{
switch
(
deferredBreakType
)
{
case
COLUMN_BREAK
:
m_bIsColumnBreakDeferred
=
false
;
break
;
case
PAGE_BREAK
:
m_bIsPageBreakDeferred
=
false
;
break
;
default
:
break
;
}
}
void
DomainMapper_Impl
::
clearDeferredBreaks
()
{
m_bIsColumnBreakDeferred
=
false
;
...
...
writerfilter/source/dmapper/DomainMapper_Impl.hxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -445,6 +445,7 @@ public:
void
deferBreak
(
BreakType
deferredBreakType
);
bool
isBreakDeferred
(
BreakType
deferredBreakType
);
void
clearDeferredBreaks
();
void
clearDeferredBreak
(
BreakType
deferredBreakType
);
void
finishParagraph
(
PropertyMapPtr
pPropertyMap
);
void
appendTextPortion
(
const
OUString
&
rString
,
PropertyMapPtr
pPropertyMap
);
void
appendTextContent
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
text
::
XTextContent
>
,
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -230,6 +230,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bFirstRun
(
true
),
m_bNeedPap
(
true
),
m_bNeedCr
(
false
),
m_bNeedCrOrig
(
false
),
m_bNeedPar
(
true
),
m_bNeedFinalPar
(
false
),
m_aListTableSprms
(),
...
...
@@ -1317,6 +1318,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aStates
.
top
().
nDestinationState
=
DESTINATION_SHAPEPROPERTYVALUE
;
break
;
case
RTF_SHP
:
m_bNeedCrOrig
=
m_bNeedCr
;
m_aStates
.
top
().
nDestinationState
=
DESTINATION_SHAPE
;
break
;
case
RTF_SHPINST
:
...
...
@@ -1937,6 +1939,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
Mapper
().
text
(
sBreak
,
1
);
if
(
!
m_bNeedPap
)
parBreak
();
m_bNeedCr
=
true
;
}
}
break
;
...
...
@@ -4134,6 +4137,7 @@ int RTFDocumentImpl::popState()
}
break
;
case
DESTINATION_SHAPE
:
m_bNeedCr
=
m_bNeedCrOrig
;
if
(
aState
.
aFrame
.
inFrame
())
{
// parBreak modify m_aStates.top() so we can't apply resetFrame directly on aState
...
...
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Dosyayı görüntüle @
b40fe8e5
...
...
@@ -516,6 +516,8 @@ namespace writerfilter {
bool
m_bNeedPap
;
/// If we need to emit a CR at the end of substream.
bool
m_bNeedCr
;
/// Original value of m_bNeedCr -- saved/restored before/after textframes.
bool
m_bNeedCrOrig
;
bool
m_bNeedPar
;
/// If set, an empty paragraph will be added at the end of the document.
bool
m_bNeedFinalPar
;
...
...
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