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
b3a1909a
Kaydet (Commit)
b3a1909a
authored
Kas 30, 2012
tarafından
Chr. Rossmanith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added Converter::convertColor with opacity parameter
Change-Id: I0f3759d8f75f2739b2815c37e8c81bc97e097ec8
üst
0d957d1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
converter.hxx
sax/inc/sax/tools/converter.hxx
+6
-1
converter.cxx
sax/source/tools/converter.cxx
+21
-1
No files found.
sax/inc/sax/tools/converter.hxx
Dosyayı görüntüle @
b3a1909a
...
@@ -95,10 +95,15 @@ public:
...
@@ -95,10 +95,15 @@ public:
static
void
convertMeasurePx
(
::
rtl
::
OUStringBuffer
&
rBuffer
,
static
void
convertMeasurePx
(
::
rtl
::
OUStringBuffer
&
rBuffer
,
sal_Int32
nValue
);
sal_Int32
nValue
);
/** convert string to color */
/** convert string to
rgb
color */
static
bool
convertColor
(
sal_Int32
&
rColor
,
static
bool
convertColor
(
sal_Int32
&
rColor
,
const
::
rtl
::
OUString
&
rValue
);
const
::
rtl
::
OUString
&
rValue
);
/** convert string to argb color */
static
bool
convertColor
(
sal_Int32
&
rColor
,
const
::
rtl
::
OUString
&
rValue
,
const
double
alpha
);
/** convert color to string */
/** convert color to string */
static
void
convertColor
(
::
rtl
::
OUStringBuffer
&
rBuffer
,
static
void
convertColor
(
::
rtl
::
OUStringBuffer
&
rBuffer
,
sal_Int32
nColor
);
sal_Int32
nColor
);
...
...
sax/source/tools/converter.cxx
Dosyayı görüntüle @
b3a1909a
...
@@ -478,7 +478,7 @@ int lcl_gethex( int nChar )
...
@@ -478,7 +478,7 @@ int lcl_gethex( int nChar )
return
0
;
return
0
;
}
}
/** convert string to color */
/** convert string to
rgb
color */
bool
Converter
::
convertColor
(
sal_Int32
&
rColor
,
const
OUString
&
rValue
)
bool
Converter
::
convertColor
(
sal_Int32
&
rColor
,
const
OUString
&
rValue
)
{
{
if
(
rValue
.
getLength
()
!=
7
||
rValue
[
0
]
!=
'#'
)
if
(
rValue
.
getLength
()
!=
7
||
rValue
[
0
]
!=
'#'
)
...
@@ -495,6 +495,26 @@ bool Converter::convertColor( sal_Int32& rColor, const OUString& rValue )
...
@@ -495,6 +495,26 @@ bool Converter::convertColor( sal_Int32& rColor, const OUString& rValue )
return
true
;
return
true
;
}
}
/** convert string to rgba color */
bool
Converter
::
convertColor
(
sal_Int32
&
rColor
,
const
OUString
&
rValue
,
const
double
alpha
)
{
if
(
rValue
.
getLength
()
!=
7
||
rValue
[
0
]
!=
'#'
)
return
false
;
rColor
=
(
int
)
(
alpha
*
255
);
rColor
<<=
8
;
rColor
|=
lcl_gethex
(
rValue
[
1
]
)
*
16
+
lcl_gethex
(
rValue
[
2
]
);
rColor
<<=
8
;
rColor
|=
(
lcl_gethex
(
rValue
[
3
]
)
*
16
+
lcl_gethex
(
rValue
[
4
]
)
);
rColor
<<=
8
;
rColor
|=
(
lcl_gethex
(
rValue
[
5
]
)
*
16
+
lcl_gethex
(
rValue
[
6
]
)
);
return
true
;
}
static
sal_Char
aHexTab
[]
=
"0123456789abcdef"
;
static
sal_Char
aHexTab
[]
=
"0123456789abcdef"
;
/** convert color to string */
/** convert color to string */
...
...
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