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
120486c8
Kaydet (Commit)
120486c8
authored
Agu 23, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Group some more common code and reduce casts
Change-Id: Ib2f23f098377a07237cdba973edd8e854db05625
üst
80343757
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
35 deletions
+13
-35
fntcache.cxx
sw/source/core/txtnode/fntcache.cxx
+13
-35
No files found.
sw/source/core/txtnode/fntcache.cxx
Dosyayı görüntüle @
120486c8
...
...
@@ -72,7 +72,7 @@ OutputDevice* SwFntObj::pPixOut = NULL;
namespace
{
sal_uInt16
GetDefaultFontHeight
(
SwDrawTextInfo
&
rInf
)
long
EvalGridWidthAdd
(
const
SwTextGridItem
*
const
pGrid
,
const
SwDrawTextInfo
&
rInf
)
{
SwDocShell
*
pDocShell
=
rInf
.
GetShell
()
->
GetDoc
()
->
GetDocShell
();
SfxStyleSheetBasePool
*
pBasePool
=
pDocShell
->
GetStyleSheetPool
();
...
...
@@ -82,7 +82,13 @@ sal_uInt16 GetDefaultFontHeight( SwDrawTextInfo &rInf )
SfxStyleSheetBase
*
pStyle
=
pBasePool
->
Find
(
sString
,
(
SfxStyleFamily
)
SFX_STYLE_FAMILY_PARA
);
SfxItemSet
&
aTmpSet
=
pStyle
->
GetItemSet
();
SvxFontHeightItem
&
aDefaultFontItem
=
(
SvxFontHeightItem
&
)
aTmpSet
.
Get
(
RES_CHRATR_CJK_FONTSIZE
);
return
(
sal_uInt16
)
aDefaultFontItem
.
GetHeight
();
const
SwDoc
*
pDoc
=
rInf
.
GetShell
()
->
GetDoc
();
const
long
nGridWidthAdd
=
GetGridWidth
(
*
pGrid
,
*
pDoc
)
-
aDefaultFontItem
.
GetHeight
();
if
(
SW_LATIN
==
rInf
.
GetFont
()
->
GetActual
()
)
return
nGridWidthAdd
/
2
;
return
nGridWidthAdd
;
}
}
...
...
@@ -996,14 +1002,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if
(
pGrid
&&
GRID_LINES_CHARS
==
pGrid
->
GetGridType
()
&&
!
pGrid
->
IsSnapToChars
()
)
{
const
sal_uInt16
nDefaultFontHeight
=
GetDefaultFontHeight
(
rInf
);
const
SwDoc
*
pDoc
=
rInf
.
GetShell
()
->
GetDoc
();
long
nGridWidthAdd
=
GetGridWidth
(
*
pGrid
,
*
pDoc
);
if
(
SW_LATIN
==
rInf
.
GetFont
()
->
GetActual
()
)
nGridWidthAdd
=
(
nGridWidthAdd
-
nDefaultFontHeight
)
/
2
;
else
nGridWidthAdd
=
nGridWidthAdd
-
nDefaultFontHeight
;
const
long
nGridWidthAdd
=
EvalGridWidthAdd
(
pGrid
,
rInf
);
long
*
pKernArray
=
new
long
[
rInf
.
GetLen
()];
...
...
@@ -1833,14 +1832,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
SwTextGridItem
const
*
const
pGrid
(
GetGridItem
(
rInf
.
GetFrm
()
->
FindPageFrm
()));
if
(
pGrid
&&
GRID_LINES_CHARS
==
pGrid
->
GetGridType
()
&&
!
pGrid
->
IsSnapToChars
()
)
{
const
sal_uInt16
nDefaultFontHeight
=
GetDefaultFontHeight
(
rInf
);
const
SwDoc
*
pDoc
=
rInf
.
GetShell
()
->
GetDoc
();
long
nGridWidthAdd
=
GetGridWidth
(
*
pGrid
,
*
pDoc
);
if
(
SW_LATIN
==
rInf
.
GetFont
()
->
GetActual
()
)
nGridWidthAdd
=
(
nGridWidthAdd
-
nDefaultFontHeight
)
/
2
;
else
nGridWidthAdd
=
nGridWidthAdd
-
nDefaultFontHeight
;
const
long
nGridWidthAdd
=
EvalGridWidthAdd
(
pGrid
,
rInf
);
OutputDevice
*
pOutDev
;
if
(
pPrinter
)
{
...
...
@@ -1853,7 +1845,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
aTxtSize
.
Width
()
=
pOutDev
->
GetTextWidth
(
rInf
.
GetText
(),
rInf
.
GetIdx
(),
nLn
);
aTxtSize
.
Height
()
=
pOutDev
->
GetTextHeight
()
+
GetFontLeading
(
rInf
.
GetShell
(),
rInf
.
GetOut
()
);
aTxtSize
.
Width
()
+=
(
nLn
)
*
long
(
nGridWidthAdd
)
;
aTxtSize
.
Width
()
+=
nLn
*
nGridWidthAdd
;
//if ( rInf.GetKern() && nLn )
// aTxtSize.Width() += ( nLn ) * long( rInf.GetKern() );
...
...
@@ -2107,14 +2099,7 @@ sal_Int32 SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
if
(
pGrid
&&
GRID_LINES_CHARS
==
pGrid
->
GetGridType
()
&&
!
pGrid
->
IsSnapToChars
()
)
{
const
sal_uInt16
nDefaultFontHeight
=
GetDefaultFontHeight
(
rInf
);
const
SwDoc
*
pDoc
=
rInf
.
GetShell
()
->
GetDoc
();
long
nGridWidthAdd
=
GetGridWidth
(
*
pGrid
,
*
pDoc
);
if
(
SW_LATIN
==
rInf
.
GetFont
()
->
GetActual
()
)
nGridWidthAdd
=
(
nGridWidthAdd
-
nDefaultFontHeight
)
/
2
;
else
nGridWidthAdd
=
nGridWidthAdd
-
nDefaultFontHeight
;
const
long
nGridWidthAdd
=
EvalGridWidthAdd
(
pGrid
,
rInf
);
for
(
sal_Int32
j
=
0
;
j
<
rInf
.
GetLen
();
j
++
)
{
...
...
@@ -2356,14 +2341,7 @@ sal_Int32 SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
SwTextGridItem
const
*
const
pGrid
(
GetGridItem
(
rInf
.
GetFrm
()
->
FindPageFrm
()));
if
(
pGrid
&&
GRID_LINES_CHARS
==
pGrid
->
GetGridType
()
&&
!
pGrid
->
IsSnapToChars
()
)
{
const
sal_uInt16
nDefaultFontHeight
=
GetDefaultFontHeight
(
rInf
);
const
SwDoc
*
pDoc
=
rInf
.
GetShell
()
->
GetDoc
();
long
nGridWidthAdd
=
GetGridWidth
(
*
pGrid
,
*
pDoc
);
if
(
SW_LATIN
==
rInf
.
GetFont
()
->
GetActual
()
)
nGridWidthAdd
=
(
nGridWidthAdd
-
nDefaultFontHeight
)
/
2
;
else
nGridWidthAdd
=
nGridWidthAdd
-
nDefaultFontHeight
;
const
long
nGridWidthAdd
=
EvalGridWidthAdd
(
pGrid
,
rInf
);
long
*
pKernArray
=
new
long
[
rInf
.
GetLen
()];
rInf
.
GetOut
().
GetTextArray
(
rInf
.
GetText
(),
pKernArray
,
...
...
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