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
8a274f73
Kaydet (Commit)
8a274f73
authored
Agu 21, 2012
tarafından
Brennan Vincent
Kaydeden (comit)
Fridrich Štrba
Agu 23, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move writerperfect newline-handling logic to OdgGenerator::insertText
Change-Id: I6d954ac1233f98a3744449555043e8f82a1d2083
üst
2b5953a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
DocumentHandler.cxx
writerperfect/source/filter/DocumentHandler.cxx
+4
-27
OdgGenerator.cxx
writerperfect/source/filter/OdgGenerator.cxx
+26
-2
No files found.
writerperfect/source/filter/DocumentHandler.cxx
Dosyayı görüntüle @
8a274f73
...
...
@@ -74,35 +74,12 @@ void DocumentHandler::endElement(const char *psName)
void
DocumentHandler
::
characters
(
const
WPXString
&
sCharacters
)
{
int
lastNewline
=
-
1
;
int
length
=
sCharacters
.
len
();
for
(
int
curr
=
0
;
curr
<
length
;
++
curr
)
{
if
(
sCharacters
.
cstr
()[
curr
]
==
'\n'
)
{
if
(
curr
>
lastNewline
+
1
)
{
OUString
sCharU16
(
sCharacters
.
cstr
()
+
lastNewline
+
1
,
curr
-
lastNewline
-
1
,
RTL_TEXTENCODING_UTF8
);
#ifdef DEBUG_XML
WPXString
sEscapedCharacters
(
sCharacters
,
true
);
printf
(
"%s"
,
sEscapedCharacters
.
cstr
());
#endif
mxHandler
->
characters
(
sCharU16
);
}
startElement
(
"text:line-break"
,
WPXPropertyList
());
endElement
(
"text:line-break"
);
lastNewline
=
curr
;
}
}
if
(
lastNewline
+
1
<
length
)
{
OUString
sCharU16
(
sCharacters
.
cstr
()
+
lastNewline
+
1
,
length
-
lastNewline
-
1
,
RTL_TEXTENCODING_UTF8
);
OUString
sCharU16
(
sCharacters
.
cstr
(),
strlen
(
sCharacters
.
cstr
()),
RTL_TEXTENCODING_UTF8
);
#ifdef DEBUG_XML
WPXString
sEscapedCharacters
(
sCharacters
,
true
);
printf
(
"%s"
,
sEscapedCharacters
.
cstr
());
WPXString
sEscapedCharacters
(
sCharacters
,
true
);
printf
(
"%s"
,
sEscapedCharacters
.
cstr
());
#endif
mxHandler
->
characters
(
sCharU16
);
}
mxHandler
->
characters
(
sCharU16
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
writerperfect/source/filter/OdgGenerator.cxx
Dosyayı görüntüle @
8a274f73
...
...
@@ -1750,8 +1750,32 @@ void OdgGenerator::endTextSpan()
void
OdgGenerator
::
insertText
(
const
WPXString
&
text
)
{
DocumentElement
*
pText
=
new
TextElement
(
text
);
mpImpl
->
mBodyElements
.
push_back
(
pText
);
int
length
=
text
.
len
();
WPXString
out
;
for
(
int
curr
=
0
;
curr
<
length
;
++
curr
)
{
char
ch
=
text
.
cstr
()[
curr
];
if
(
ch
==
'\n'
)
{
if
(
out
.
len
()
!=
0
)
{
DocumentElement
*
pText
=
new
TextElement
(
out
);
mpImpl
->
mBodyElements
.
push_back
(
pText
);
out
.
clear
();
}
mpImpl
->
mBodyElements
.
push_back
(
new
TagOpenElement
(
"text:line-break"
));
mpImpl
->
mBodyElements
.
push_back
(
new
TagCloseElement
(
"text:line-break"
));
}
else
{
out
.
append
(
ch
);
}
}
if
(
out
.
len
()
!=
0
)
{
DocumentElement
*
pText
=
new
TextElement
(
out
);
mpImpl
->
mBodyElements
.
push_back
(
pText
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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