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
cc7a94cf
Kaydet (Commit)
cc7a94cf
authored
Agu 17, 2013
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reduce text background painting rect with border
Change-Id: I48fa36aafa17b9660c65ed713ae2faf9c0c4d056
üst
d055f7eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
11 deletions
+50
-11
swfont.hxx
sw/source/core/inc/swfont.hxx
+26
-1
inftxt.cxx
sw/source/core/text/inftxt.cxx
+23
-9
inftxt.hxx
sw/source/core/text/inftxt.hxx
+1
-1
No files found.
sw/source/core/inc/swfont.hxx
Dosyayı görüntüle @
cc7a94cf
...
@@ -396,7 +396,12 @@ public:
...
@@ -396,7 +396,12 @@ public:
sal_uInt16
GetRightBorderDist
()
const
{
return
m_nRightBorderDist
;
}
sal_uInt16
GetRightBorderDist
()
const
{
return
m_nRightBorderDist
;
}
sal_uInt16
GetLeftBorderDist
()
const
{
return
m_nLeftBorderDist
;
}
sal_uInt16
GetLeftBorderDist
()
const
{
return
m_nLeftBorderDist
;
}
// Return with the border width plus spacing
sal_uInt16
GetTopBorderWidth
()
const
;
sal_uInt16
GetBottomBorderWidth
()
const
;
sal_uInt16
GetRightBorderWidth
()
const
;
sal_uInt16
GetLeftBorderWidth
()
const
;
// Return the border width plus spacing
sal_uInt16
GetTopBorderSpace
()
const
;
sal_uInt16
GetTopBorderSpace
()
const
;
sal_uInt16
GetBottomBorderSpace
()
const
;
sal_uInt16
GetBottomBorderSpace
()
const
;
sal_uInt16
GetRightBorderSpace
()
const
;
sal_uInt16
GetRightBorderSpace
()
const
;
...
@@ -881,6 +886,26 @@ inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
...
@@ -881,6 +886,26 @@ inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
aSub
[
SW_LATIN
].
pMagic
=
aSub
[
SW_CJK
].
pMagic
=
aSub
[
SW_CTL
].
pMagic
=
0
;
aSub
[
SW_LATIN
].
pMagic
=
aSub
[
SW_CJK
].
pMagic
=
aSub
[
SW_CTL
].
pMagic
=
0
;
}
}
inline
sal_uInt16
SwFont
::
GetTopBorderWidth
()
const
{
return
m_aTopBorder
?
m_aTopBorder
.
get
().
GetScaledWidth
()
:
0
;
}
inline
sal_uInt16
SwFont
::
GetBottomBorderWidth
()
const
{
return
m_aBottomBorder
?
m_aBottomBorder
.
get
().
GetScaledWidth
()
:
0
;
}
inline
sal_uInt16
SwFont
::
GetRightBorderWidth
()
const
{
return
m_aRightBorder
?
m_aRightBorder
.
get
().
GetScaledWidth
()
:
0
;
}
inline
sal_uInt16
SwFont
::
GetLeftBorderWidth
()
const
{
return
m_aLeftBorder
?
m_aLeftBorder
.
get
().
GetScaledWidth
()
:
0
;
}
inline
sal_uInt16
SwFont
::
GetTopBorderSpace
()
const
inline
sal_uInt16
SwFont
::
GetTopBorderSpace
()
const
{
{
if
(
m_aTopBorder
)
if
(
m_aTopBorder
)
...
...
sw/source/core/text/inftxt.cxx
Dosyayı görüntüle @
cc7a94cf
...
@@ -748,9 +748,23 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
...
@@ -748,9 +748,23 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
}
}
void
SwTxtPaintInfo
::
CalcRect
(
const
SwLinePortion
&
rPor
,
void
SwTxtPaintInfo
::
CalcRect
(
const
SwLinePortion
&
rPor
,
SwRect
*
pRect
,
SwRect
*
pIntersect
)
const
SwRect
*
pRect
,
SwRect
*
pIntersect
,
const
bool
bInsideBorder
)
const
{
{
Size
aSize
(
rPor
.
Width
(),
rPor
.
Height
()
);
KSHORT
nPorHeight
=
rPor
.
Height
();
KSHORT
nPorAscent
=
rPor
.
GetAscent
();
KSHORT
nPorWidth
=
rPor
.
Width
();
SwTwips
nX
=
X
();
if
(
bInsideBorder
)
{
nPorAscent
-=
GetFont
()
->
GetTopBorderWidth
();
nPorHeight
-=
GetFont
()
->
GetTopBorderWidth
()
+
GetFont
()
->
GetBottomBorderWidth
();
nPorWidth
-=
GetFont
()
->
GetRightBorderWidth
()
+
GetFont
()
->
GetLeftBorderWidth
();
nX
+=
GetFont
()
->
GetLeftBorderWidth
();
}
Size
aSize
(
nPorWidth
,
nPorHeight
);
if
(
rPor
.
IsHangingPortion
()
)
if
(
rPor
.
IsHangingPortion
()
)
aSize
.
Width
()
=
((
SwHangingPortion
&
)
rPor
).
GetInnerWidth
();
aSize
.
Width
()
=
((
SwHangingPortion
&
)
rPor
).
GetInnerWidth
();
if
(
rPor
.
InSpaceGrp
()
&&
GetSpaceAdd
()
)
if
(
rPor
.
InSpaceGrp
()
&&
GetSpaceAdd
()
)
...
@@ -770,23 +784,23 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
...
@@ -770,23 +784,23 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
aSize
.
Height
()
=
nTmp
;
aSize
.
Height
()
=
nTmp
;
if
(
1
==
GetDirection
()
)
if
(
1
==
GetDirection
()
)
{
{
aPoint
.
A
()
=
X
()
-
rPor
.
GetAscent
()
;
aPoint
.
A
()
=
nX
-
nPorAscent
;
aPoint
.
B
()
=
Y
()
-
aSize
.
Height
();
aPoint
.
B
()
=
Y
()
-
aSize
.
Height
();
}
}
else
else
{
{
aPoint
.
A
()
=
X
()
-
rPor
.
Height
()
+
rPor
.
GetAscent
()
;
aPoint
.
A
()
=
nX
-
nPorHeight
+
nPorAscent
;
aPoint
.
B
()
=
Y
();
aPoint
.
B
()
=
Y
();
}
}
}
}
else
else
{
{
aPoint
.
A
()
=
X
()
;
aPoint
.
A
()
=
nX
;
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if
(
GetTxtFrm
()
->
IsVertLR
()
)
if
(
GetTxtFrm
()
->
IsVertLR
()
)
aPoint
.
B
()
=
Y
()
-
rPor
.
Height
()
+
rPor
.
GetAscent
()
;
aPoint
.
B
()
=
Y
()
-
nPorHeight
+
nPorAscent
;
else
else
aPoint
.
B
()
=
Y
()
-
rPor
.
GetAscent
()
;
aPoint
.
B
()
=
Y
()
-
nPorAscent
;
}
}
// Adjust x coordinate if we are inside a bidi portion
// Adjust x coordinate if we are inside a bidi portion
...
@@ -1124,7 +1138,7 @@ void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const
...
@@ -1124,7 +1138,7 @@ void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const
OSL_ENSURE
(
OnWin
(),
"SwTxtPaintInfo::DrawBackground: printer pollution ?"
);
OSL_ENSURE
(
OnWin
(),
"SwTxtPaintInfo::DrawBackground: printer pollution ?"
);
SwRect
aIntersect
;
SwRect
aIntersect
;
CalcRect
(
rPor
,
0
,
&
aIntersect
);
CalcRect
(
rPor
,
0
,
&
aIntersect
,
true
);
if
(
aIntersect
.
HasArea
()
)
if
(
aIntersect
.
HasArea
()
)
{
{
...
@@ -1209,7 +1223,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
...
@@ -1209,7 +1223,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
OSL_ENSURE
(
m_pFnt
->
GetBackColor
(),
"DrawBackBrush: Lost Color"
);
OSL_ENSURE
(
m_pFnt
->
GetBackColor
(),
"DrawBackBrush: Lost Color"
);
SwRect
aIntersect
;
SwRect
aIntersect
;
CalcRect
(
rPor
,
0
,
&
aIntersect
);
CalcRect
(
rPor
,
0
,
&
aIntersect
,
true
);
if
(
aIntersect
.
HasArea
()
)
if
(
aIntersect
.
HasArea
()
)
{
{
...
...
sw/source/core/text/inftxt.hxx
Dosyayı görüntüle @
cc7a94cf
...
@@ -449,7 +449,7 @@ public:
...
@@ -449,7 +449,7 @@ public:
inline
void
NotifyURL
(
const
SwLinePortion
&
rPor
)
const
inline
void
NotifyURL
(
const
SwLinePortion
&
rPor
)
const
{
if
(
URLNotify
()
)
_NotifyURL
(
rPor
);
}
{
if
(
URLNotify
()
)
_NotifyURL
(
rPor
);
}
void
CalcRect
(
const
SwLinePortion
&
rPor
,
SwRect
*
pRect
,
SwRect
*
pIntersect
=
0
)
const
;
void
CalcRect
(
const
SwLinePortion
&
rPor
,
SwRect
*
pRect
,
SwRect
*
pIntersect
=
0
,
const
bool
bInsideBorder
=
false
)
const
;
inline
SwTwips
GetPaintOfst
()
const
;
inline
SwTwips
GetPaintOfst
()
const
;
inline
void
SetPaintOfst
(
const
SwTwips
nNew
);
inline
void
SetPaintOfst
(
const
SwTwips
nNew
);
...
...
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