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
06941b06
Kaydet (Commit)
06941b06
authored
Eki 02, 2013
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String to OUString
Change-Id: I03949be73025d8b58ee35648d95e76b3ac1df2b8
üst
ea1e3b77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
19 deletions
+17
-19
srcview.cxx
sw/source/ui/uiview/srcview.cxx
+17
-19
No files found.
sw/source/ui/uiview/srcview.cxx
Dosyayı görüntüle @
06941b06
...
...
@@ -192,26 +192,26 @@ static rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding)
return
eRet
;
}
static
void
lcl_ConvertTabsToSpaces
(
String
&
r
Line
)
static
OUString
lcl_ConvertTabsToSpaces
(
OUString
s
Line
)
{
if
(
rLine
.
Len
()
)
if
(
!
sLine
.
isEmpty
()
)
{
sal_uInt16
nPos
=
0
;
sal_
uInt16
nMax
=
rLine
.
Len
()
;
while
(
nPos
<
nMax
)
const
sal_Unicode
aPadSpaces
[
4
]
=
{
' '
,
' '
,
' '
,
' '
}
;
sal_
Int32
nPos
=
0
;
for
(;;
)
{
if
(
rLine
.
GetChar
(
nPos
)
==
'\t'
)
nPos
=
sLine
.
indexOf
(
'\t'
,
nPos
);
if
(
nPos
<
0
)
{
// Not 4 blanks, but on 4th TabPos:
OUStringBuffer
aBlanker
;
comphelper
::
string
::
padToLength
(
aBlanker
,
(
4
-
(
nPos
%
4
)
),
' '
);
rLine
.
Erase
(
nPos
,
1
);
rLine
.
Insert
(
aBlanker
.
makeStringAndClear
(),
nPos
);
nMax
=
rLine
.
Len
();
break
;
}
nPos
++
;
// Not optimally, if tab, but not wrong...
// Not 4 blanks, but on 4th TabPos:
const
sal_Int32
nPadLen
=
4
-
(
nPos
%
4
);
sLine
.
replaceAt
(
nPos
,
1
,
OUString
(
aPadSpaces
,
nPadLen
));
nPos
+=
nPadLen
;
}
}
return
sLine
;
}
SwSrcView
::
SwSrcView
(
SfxViewFrame
*
pViewFrame
,
SfxViewShell
*
)
:
...
...
@@ -734,12 +734,10 @@ sal_Int32 SwSrcView::PrintSource(
Point
aPos
(
aStartPos
);
for
(
sal_uInt16
nPara
=
0
;
nPara
<
nParas
;
++
nPara
)
{
String
aLine
(
pTextEngine
->
GetText
(
nPara
)
);
lcl_ConvertTabsToSpaces
(
aLine
);
sal_uInt16
nLines
=
aLine
.
Len
()
/
nCharspLine
+
1
;
for
(
sal_uInt16
nLine
=
0
;
nLine
<
nLines
;
++
nLine
)
const
OUString
aLine
(
lcl_ConvertTabsToSpaces
(
pTextEngine
->
GetText
(
nPara
))
);
sal_Int32
nLines
=
aLine
.
getLength
()
/
nCharspLine
+
1
;
for
(
sal_Int32
nLine
=
0
;
nLine
<
nLines
;
++
nLine
)
{
String
aTmpLine
(
aLine
,
nLine
*
nCharspLine
,
nCharspLine
);
aPos
.
Y
()
+=
nLineHeight
;
if
(
aPos
.
Y
()
>
(
aPaperSz
.
Height
()
+
TMARGPRN
-
nLineHeight
/
2
)
)
{
...
...
@@ -749,7 +747,7 @@ sal_Int32 SwSrcView::PrintSource(
aPos
=
aStartPos
;
}
if
(
!
bCalcNumPagesOnly
&&
nPage
==
nCurPage
)
pOutDev
->
DrawText
(
aPos
,
a
TmpLine
);
pOutDev
->
DrawText
(
aPos
,
a
Line
.
copy
(
nLine
*
nCharspLine
,
nCharspLine
)
);
}
aPos
.
Y
()
+=
nParaSpace
;
}
...
...
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