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
c450ea69
Kaydet (Commit)
c450ea69
authored
May 07, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
introduce msfilter::util::BGRToRGB to avoid copy&paste
Change-Id: Ic3fa8865bf3862407867b5e4a438e3d9bc723e86
üst
71bf95db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
30 deletions
+21
-30
util.hxx
filter/inc/filter/msfilter/util.hxx
+2
-0
util.cxx
filter/source/msfilter/util.cxx
+11
-0
ww8par6.cxx
sw/source/filter/ww8/ww8par6.cxx
+3
-14
ww8struc.hxx
sw/source/filter/ww8/ww8struc.hxx
+2
-2
rtfsdrimport.cxx
writerfilter/source/rtftok/rtfsdrimport.cxx
+3
-14
No files found.
filter/inc/filter/msfilter/util.hxx
Dosyayı görüntüle @
c450ea69
...
@@ -41,6 +41,8 @@ namespace util {
...
@@ -41,6 +41,8 @@ namespace util {
/// what the encoding is, but you know or can guess the language
/// what the encoding is, but you know or can guess the language
MSFILTER_DLLPUBLIC
rtl_TextEncoding
getBestTextEncodingFromLocale
(
const
::
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
);
MSFILTER_DLLPUBLIC
rtl_TextEncoding
getBestTextEncodingFromLocale
(
const
::
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
);
/// Convert a color in BGR format to RGB.
MSFILTER_DLLPUBLIC
sal_uInt32
BGRToRGB
(
sal_uInt32
nColour
);
}
}
}
}
...
...
filter/source/msfilter/util.cxx
Dosyayı görüntüle @
c450ea69
...
@@ -51,6 +51,17 @@ rtl_TextEncoding getBestTextEncodingFromLocale(const ::com::sun::star::lang::Loc
...
@@ -51,6 +51,17 @@ rtl_TextEncoding getBestTextEncodingFromLocale(const ::com::sun::star::lang::Loc
return
RTL_TEXTENCODING_MS_1252
;
return
RTL_TEXTENCODING_MS_1252
;
}
}
sal_uInt32
BGRToRGB
(
sal_uInt32
nColor
)
{
sal_uInt8
r
(
static_cast
<
sal_uInt8
>
(
nColor
&
0xFF
)),
g
(
static_cast
<
sal_uInt8
>
(((
nColor
)
>>
8
)
&
0xFF
)),
b
(
static_cast
<
sal_uInt8
>
((
nColor
>>
16
)
&
0xFF
)),
t
(
static_cast
<
sal_uInt8
>
((
nColor
>>
24
)
&
0xFF
));
nColor
=
(
t
<<
24
)
+
(
r
<<
16
)
+
(
g
<<
8
)
+
b
;
return
nColor
;
}
}
}
}
}
...
...
sw/source/filter/ww8/ww8par6.cxx
Dosyayı görüntüle @
c450ea69
...
@@ -3363,24 +3363,13 @@ void SwWW8ImplReader::Read_TxtColor( sal_uInt16, const sal_uInt8* pData, short n
...
@@ -3363,24 +3363,13 @@ void SwWW8ImplReader::Read_TxtColor( sal_uInt16, const sal_uInt8* pData, short n
}
}
}
}
sal_uInt32
wwUtility
::
BGRToRGB
(
sal_uInt32
nColor
)
{
sal_uInt8
r
(
static_cast
<
sal_uInt8
>
(
nColor
&
0xFF
)),
g
(
static_cast
<
sal_uInt8
>
(((
nColor
)
>>
8
)
&
0xFF
)),
b
(
static_cast
<
sal_uInt8
>
((
nColor
>>
16
)
&
0xFF
)),
t
(
static_cast
<
sal_uInt8
>
((
nColor
>>
24
)
&
0xFF
));
nColor
=
(
t
<<
24
)
+
(
r
<<
16
)
+
(
g
<<
8
)
+
b
;
return
nColor
;
}
void
SwWW8ImplReader
::
Read_TxtForeColor
(
sal_uInt16
,
const
sal_uInt8
*
pData
,
short
nLen
)
void
SwWW8ImplReader
::
Read_TxtForeColor
(
sal_uInt16
,
const
sal_uInt8
*
pData
,
short
nLen
)
{
{
if
(
nLen
<
0
)
if
(
nLen
<
0
)
pCtrlStck
->
SetAttr
(
*
pPaM
->
GetPoint
(),
RES_CHRATR_COLOR
);
pCtrlStck
->
SetAttr
(
*
pPaM
->
GetPoint
(),
RES_CHRATR_COLOR
);
else
else
{
{
Color
aColor
(
wwUtility
::
BGRToRGB
(
SVBT32ToUInt32
(
pData
)));
Color
aColor
(
msfilter
::
util
::
BGRToRGB
(
SVBT32ToUInt32
(
pData
)));
NewAttr
(
SvxColorItem
(
aColor
,
RES_CHRATR_COLOR
));
NewAttr
(
SvxColorItem
(
aColor
,
RES_CHRATR_COLOR
));
if
(
pAktColl
&&
pStyles
)
if
(
pAktColl
&&
pStyles
)
pStyles
->
bTxtColChanged
=
true
;
pStyles
->
bTxtColChanged
=
true
;
...
@@ -4663,9 +4652,9 @@ sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67)
...
@@ -4663,9 +4652,9 @@ sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67)
{
{
(
void
)
bVer67
;
// unused in non-debug
(
void
)
bVer67
;
// unused in non-debug
OSL_ENSURE
(
bVer67
==
false
,
"Impossible"
);
OSL_ENSURE
(
bVer67
==
false
,
"Impossible"
);
sal_uInt32
nFore
=
wwUtility
::
BGRToRGB
(
SVBT32ToUInt32
(
rpData
));
sal_uInt32
nFore
=
msfilter
::
util
::
BGRToRGB
(
SVBT32ToUInt32
(
rpData
));
rpData
+=
4
;
rpData
+=
4
;
sal_uInt32
nBack
=
wwUtility
::
BGRToRGB
(
SVBT32ToUInt32
(
rpData
));
sal_uInt32
nBack
=
msfilter
::
util
::
BGRToRGB
(
SVBT32ToUInt32
(
rpData
));
rpData
+=
4
;
rpData
+=
4
;
sal_uInt16
nIndex
=
SVBT16ToShort
(
rpData
);
sal_uInt16
nIndex
=
SVBT16ToShort
(
rpData
);
rpData
+=
2
;
rpData
+=
2
;
...
...
sw/source/filter/ww8/ww8struc.hxx
Dosyayı görüntüle @
c450ea69
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <sal/config.h>
#include <sal/config.h>
#include <editeng/borderline.hxx>
#include <editeng/borderline.hxx>
#include <filter/msfilter/util.hxx>
#if defined OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
#if defined OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
# define __WW8_NEEDS_COPY
# define __WW8_NEEDS_COPY
...
@@ -978,8 +979,7 @@ struct SEPr
...
@@ -978,8 +979,7 @@ struct SEPr
namespace
wwUtility
namespace
wwUtility
{
{
sal_uInt32
BGRToRGB
(
sal_uInt32
nColour
);
inline
sal_uInt32
RGBToBGR
(
sal_uInt32
nColour
)
{
return
msfilter
::
util
::
BGRToRGB
(
nColour
);
}
inline
sal_uInt32
RGBToBGR
(
sal_uInt32
nColour
)
{
return
BGRToRGB
(
nColour
);
}
}
}
#endif
#endif
...
...
writerfilter/source/rtftok/rtfsdrimport.cxx
Dosyayı görüntüle @
c450ea69
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <ooxml/resourceids.hxx> // NS_ooxml namespace
#include <ooxml/resourceids.hxx> // NS_ooxml namespace
#include <filter/msfilter/escherex.hxx>
#include <filter/msfilter/escherex.hxx>
#include <filter/msfilter/util.hxx>
#include <rtfsdrimport.hxx>
#include <rtfsdrimport.hxx>
...
@@ -44,18 +45,6 @@ using rtl::OUString;
...
@@ -44,18 +45,6 @@ using rtl::OUString;
using
rtl
::
OUStringBuffer
;
using
rtl
::
OUStringBuffer
;
using
rtl
::
OUStringToOString
;
using
rtl
::
OUStringToOString
;
// NEEDSWORK: wwUtility::BGRToRGB does the same.
static
sal_uInt32
lcl_BGRToRGB
(
sal_uInt32
nColor
)
{
sal_uInt8
r
(
static_cast
<
sal_uInt8
>
(
nColor
&
0xFF
)),
g
(
static_cast
<
sal_uInt8
>
(((
nColor
)
>>
8
)
&
0xFF
)),
b
(
static_cast
<
sal_uInt8
>
((
nColor
>>
16
)
&
0xFF
)),
t
(
static_cast
<
sal_uInt8
>
((
nColor
>>
24
)
&
0xFF
));
nColor
=
(
t
<<
24
)
+
(
r
<<
16
)
+
(
g
<<
8
)
+
b
;
return
nColor
;
}
namespace
writerfilter
{
namespace
writerfilter
{
namespace
rtftok
{
namespace
rtftok
{
...
@@ -132,14 +121,14 @@ void RTFSdrImport::resolve(RTFShape& rShape)
...
@@ -132,14 +121,14 @@ void RTFSdrImport::resolve(RTFShape& rShape)
}
}
else
if
(
i
->
first
==
"fillColor"
&&
xPropertySet
.
is
())
else
if
(
i
->
first
==
"fillColor"
&&
xPropertySet
.
is
())
{
{
aAny
<<=
lcl_
BGRToRGB
(
i
->
second
.
toInt32
());
aAny
<<=
msfilter
::
util
::
BGRToRGB
(
i
->
second
.
toInt32
());
xPropertySet
->
setPropertyValue
(
"FillColor"
,
aAny
);
xPropertySet
->
setPropertyValue
(
"FillColor"
,
aAny
);
}
}
else
if
(
i
->
first
==
"fillBackColor"
)
else
if
(
i
->
first
==
"fillBackColor"
)
;
// Ignore: complementer of fillColor
;
// Ignore: complementer of fillColor
else
if
(
i
->
first
==
"lineColor"
&&
xPropertySet
.
is
())
else
if
(
i
->
first
==
"lineColor"
&&
xPropertySet
.
is
())
{
{
aAny
<<=
lcl_
BGRToRGB
(
i
->
second
.
toInt32
());
aAny
<<=
msfilter
::
util
::
BGRToRGB
(
i
->
second
.
toInt32
());
xPropertySet
->
setPropertyValue
(
"LineColor"
,
aAny
);
xPropertySet
->
setPropertyValue
(
"LineColor"
,
aAny
);
}
}
else
if
(
i
->
first
==
"lineBackColor"
)
else
if
(
i
->
first
==
"lineBackColor"
)
...
...
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