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
1a4d24b3
Kaydet (Commit)
1a4d24b3
authored
May 11, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: fix indentation in rtfsdrexport
Change-Id: I5499007c88659b2d235c765ba352e2bc4a8a3eb8
üst
b05778b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
115 deletions
+126
-115
rtfsdrexport.cxx
sw/source/filter/ww8/rtfsdrexport.cxx
+113
-102
rtfsdrexport.hxx
sw/source/filter/ww8/rtfsdrexport.hxx
+13
-13
No files found.
sw/source/filter/ww8/rtfsdrexport.cxx
Dosyayı görüntüle @
1a4d24b3
...
...
@@ -33,18 +33,18 @@
using
namespace
sw
::
util
;
using
namespace
css
;
RtfSdrExport
::
RtfSdrExport
(
RtfExport
&
rExport
)
:
EscherEx
(
EscherExGlobalRef
(
new
EscherExGlobal
),
0
),
m_rExport
(
rExport
),
m_rAttrOutput
(
(
RtfAttributeOutput
&
)
m_rExport
.
AttrOutput
()
),
m_pSdrObject
(
NULL
),
m_nShapeType
(
ESCHER_ShpInst_Nil
),
m_nShapeFlags
(
0
)
,
m_pShapeStyle
(
new
OStringBuffer
(
200
)
),
m_pShapeTypeWritten
(
new
bool
[
ESCHER_ShpInst_COUNT
]
)
RtfSdrExport
::
RtfSdrExport
(
RtfExport
&
rExport
)
:
EscherEx
(
EscherExGlobalRef
(
new
EscherExGlobal
),
0
),
m_rExport
(
rExport
),
m_rAttrOutput
(
(
RtfAttributeOutput
&
)
m_rExport
.
AttrOutput
()
),
m_pSdrObject
(
NULL
),
m_nShapeType
(
ESCHER_ShpInst_Nil
),
m_nShapeFlags
(
0
)
,
m_pShapeStyle
(
new
OStringBuffer
(
200
)
),
m_pShapeTypeWritten
(
new
bool
[
ESCHER_ShpInst_COUNT
]
)
{
mnGroupLevel
=
1
;
memset
(
m_pShapeTypeWritten
,
0
,
ESCHER_ShpInst_COUNT
*
sizeof
(
bool
)
);
memset
(
m_pShapeTypeWritten
,
0
,
ESCHER_ShpInst_COUNT
*
sizeof
(
bool
)
);
}
RtfSdrExport
::~
RtfSdrExport
()
...
...
@@ -54,18 +54,18 @@ RtfSdrExport::~RtfSdrExport()
delete
[]
m_pShapeTypeWritten
,
m_pShapeTypeWritten
=
NULL
;
}
void
RtfSdrExport
::
OpenContainer
(
sal_uInt16
nEscherContainer
,
int
nRecInstance
)
void
RtfSdrExport
::
OpenContainer
(
sal_uInt16
nEscherContainer
,
int
nRecInstance
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
EscherEx
::
OpenContainer
(
nEscherContainer
,
nRecInstance
);
EscherEx
::
OpenContainer
(
nEscherContainer
,
nRecInstance
);
if
(
nEscherContainer
==
ESCHER_SpContainer
)
if
(
nEscherContainer
==
ESCHER_SpContainer
)
{
m_nShapeType
=
ESCHER_ShpInst_Nil
;
if
(
!
m_pShapeStyle
->
isEmpty
()
)
if
(
!
m_pShapeStyle
->
isEmpty
()
)
m_pShapeStyle
->
makeStringAndClear
();
m_pShapeStyle
->
ensureCapacity
(
200
);
m_pShapeStyle
->
ensureCapacity
(
200
);
m_aShapeProps
.
clear
();
}
}
...
...
@@ -74,11 +74,11 @@ void RtfSdrExport::CloseContainer()
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
if
(
mRecTypes
.
back
()
==
ESCHER_SpContainer
)
if
(
mRecTypes
.
back
()
==
ESCHER_SpContainer
)
{
// write the shape now when we have all the info
sal_Int32
nShapeElement
=
StartShape
();
EndShape
(
nShapeElement
);
EndShape
(
nShapeElement
);
// cleanup
m_nShapeType
=
ESCHER_ShpInst_Nil
;
...
...
@@ -87,7 +87,7 @@ void RtfSdrExport::CloseContainer()
EscherEx
::
CloseContainer
();
}
sal_uInt32
RtfSdrExport
::
EnterGroup
(
const
OUString
&
/*rShapeName*/
,
const
Rectangle
*
/*pRect*/
)
sal_uInt32
RtfSdrExport
::
EnterGroup
(
const
OUString
&
/*rShapeName*/
,
const
Rectangle
*
/*pRect*/
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
...
...
@@ -101,7 +101,7 @@ void RtfSdrExport::LeaveGroup()
/* noop */
}
void
RtfSdrExport
::
AddShape
(
sal_uInt32
nShapeType
,
sal_uInt32
nShapeFlags
,
sal_uInt32
/*nShapeId*/
)
void
RtfSdrExport
::
AddShape
(
sal_uInt32
nShapeType
,
sal_uInt32
nShapeFlags
,
sal_uInt32
/*nShapeId*/
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
...
...
@@ -109,30 +109,30 @@ void RtfSdrExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_
m_nShapeFlags
=
nShapeFlags
;
}
inline
sal_uInt16
impl_GetUInt16
(
const
sal_uInt8
*
&
pVal
)
inline
sal_uInt16
impl_GetUInt16
(
const
sal_uInt8
*&
pVal
)
{
sal_uInt16
nRet
=
*
pVal
++
;
nRet
+=
(
*
pVal
++
)
<<
8
;
nRet
+=
(
*
pVal
++
)
<<
8
;
return
nRet
;
}
inline
sal_Int32
impl_GetPointComponent
(
const
sal_uInt8
*
&
pVal
,
sal_Size
&
rVerticesPos
,
sal_uInt16
nPointSize
)
inline
sal_Int32
impl_GetPointComponent
(
const
sal_uInt8
*&
pVal
,
sal_Size
&
rVerticesPos
,
sal_uInt16
nPointSize
)
{
sal_Int32
nRet
=
0
;
if
(
(
nPointSize
==
0xfff0
)
||
(
nPointSize
==
4
)
)
if
(
(
nPointSize
==
0xfff0
)
||
(
nPointSize
==
4
)
)
{
sal_uInt16
nUnsigned
=
*
pVal
++
;
nUnsigned
+=
(
*
pVal
++
)
<<
8
;
nUnsigned
+=
(
*
pVal
++
)
<<
8
;
rVerticesPos
+=
2
;
nRet
=
sal_Int16
(
nUnsigned
);
nRet
=
sal_Int16
(
nUnsigned
);
}
else
if
(
nPointSize
==
8
)
else
if
(
nPointSize
==
8
)
{
sal_uInt32
nUnsigned
=
*
pVal
++
;
nUnsigned
+=
(
*
pVal
++
)
<<
8
;
nUnsigned
+=
(
*
pVal
++
)
<<
16
;
nUnsigned
+=
(
*
pVal
++
)
<<
24
;
nUnsigned
+=
(
*
pVal
++
)
<<
8
;
nUnsigned
+=
(
*
pVal
++
)
<<
16
;
nUnsigned
+=
(
*
pVal
++
)
<<
24
;
rVerticesPos
+=
4
;
nRet
=
nUnsigned
;
...
...
@@ -141,38 +141,48 @@ inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_Size& rVert
return
nRet
;
}
void
RtfSdrExport
::
Commit
(
EscherPropertyContainer
&
rProps
,
const
Rectangle
&
rRect
)
void
RtfSdrExport
::
Commit
(
EscherPropertyContainer
&
rProps
,
const
Rectangle
&
rRect
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
if
(
m_nShapeType
==
ESCHER_ShpInst_Nil
)
if
(
m_nShapeType
==
ESCHER_ShpInst_Nil
)
return
;
if
(
m_nShapeType
==
ESCHER_ShpInst_Line
)
AddLineDimensions
(
rRect
);
if
(
m_nShapeType
==
ESCHER_ShpInst_Line
)
AddLineDimensions
(
rRect
);
else
AddRectangleDimensions
(
*
m_pShapeStyle
,
rRect
);
AddRectangleDimensions
(
*
m_pShapeStyle
,
rRect
);
// properties
const
EscherProperties
&
rOpts
=
rProps
.
GetOpts
();
for
(
EscherProperties
::
const_iterator
it
=
rOpts
.
begin
();
it
!=
rOpts
.
end
();
++
it
)
const
EscherProperties
&
rOpts
=
rProps
.
GetOpts
();
for
(
EscherProperties
::
const_iterator
it
=
rOpts
.
begin
();
it
!=
rOpts
.
end
();
++
it
)
{
sal_uInt16
nId
=
(
it
->
nPropId
&
0x0FFF
);
sal_uInt16
nId
=
(
it
->
nPropId
&
0x0FFF
);
switch
(
nId
)
switch
(
nId
)
{
case
ESCHER_Prop_WrapText
:
{
int
nWrapType
=
0
;
switch
(
it
->
nPropValue
)
switch
(
it
->
nPropValue
)
{
case
ESCHER_WrapSquare
:
nWrapType
=
2
;
break
;
case
ESCHER_WrapByPoints
:
nWrapType
=
4
;
break
;
case
ESCHER_WrapNone
:
nWrapType
=
3
;
break
;
case
ESCHER_WrapTopBottom
:
nWrapType
=
1
;
break
;
case
ESCHER_WrapThrough
:
nWrapType
=
5
;
break
;
case
ESCHER_WrapSquare
:
nWrapType
=
2
;
break
;
case
ESCHER_WrapByPoints
:
nWrapType
=
4
;
break
;
case
ESCHER_WrapNone
:
nWrapType
=
3
;
break
;
case
ESCHER_WrapTopBottom
:
nWrapType
=
1
;
break
;
case
ESCHER_WrapThrough
:
nWrapType
=
5
;
break
;
}
if
(
nWrapType
)
if
(
nWrapType
)
m_pShapeStyle
->
append
(
OOO_STRING_SVTOOLS_RTF_SHPWR
).
append
((
sal_Int32
)
nWrapType
);
}
break
;
...
...
@@ -191,7 +201,7 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
break
;
case
ESCHER_Prop_fNoLineDrawDash
:
// for some reason the value is set to 0x90000 if lines are switched off
if
(
it
->
nPropValue
==
0x90000
)
if
(
it
->
nPropValue
==
0x90000
)
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"fLine"
,
OString
::
number
(
0
)));
break
;
case
ESCHER_Prop_lineColor
:
...
...
@@ -212,21 +222,21 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
{
sal_uInt32
nLeft
=
0
,
nTop
=
0
;
if
(
nId
==
ESCHER_Prop_geoLeft
)
if
(
nId
==
ESCHER_Prop_geoLeft
)
{
nLeft
=
it
->
nPropValue
;
rProps
.
GetOpt
(
ESCHER_Prop_geoTop
,
nTop
);
rProps
.
GetOpt
(
ESCHER_Prop_geoTop
,
nTop
);
}
else
{
nTop
=
it
->
nPropValue
;
rProps
.
GetOpt
(
ESCHER_Prop_geoLeft
,
nLeft
);
rProps
.
GetOpt
(
ESCHER_Prop_geoLeft
,
nLeft
);
}
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"geoLeft"
,
OString
::
number
(
sal_Int32
(
nLeft
))));
OString
::
number
(
sal_Int32
(
nLeft
))));
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"geoTop"
,
OString
::
number
(
sal_Int32
(
nTop
))));
OString
::
number
(
sal_Int32
(
nTop
))));
}
break
;
...
...
@@ -234,24 +244,24 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
case
ESCHER_Prop_geoBottom
:
{
sal_uInt32
nLeft
=
0
,
nRight
=
0
,
nTop
=
0
,
nBottom
=
0
;
rProps
.
GetOpt
(
ESCHER_Prop_geoLeft
,
nLeft
);
rProps
.
GetOpt
(
ESCHER_Prop_geoTop
,
nTop
);
rProps
.
GetOpt
(
ESCHER_Prop_geoLeft
,
nLeft
);
rProps
.
GetOpt
(
ESCHER_Prop_geoTop
,
nTop
);
if
(
nId
==
ESCHER_Prop_geoRight
)
if
(
nId
==
ESCHER_Prop_geoRight
)
{
nRight
=
it
->
nPropValue
;
rProps
.
GetOpt
(
ESCHER_Prop_geoBottom
,
nBottom
);
rProps
.
GetOpt
(
ESCHER_Prop_geoBottom
,
nBottom
);
}
else
{
nBottom
=
it
->
nPropValue
;
rProps
.
GetOpt
(
ESCHER_Prop_geoRight
,
nRight
);
rProps
.
GetOpt
(
ESCHER_Prop_geoRight
,
nRight
);
}
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"geoRight"
,
OString
::
number
(
sal_Int32
(
nRight
)
-
sal_Int32
(
nLeft
))));
OString
::
number
(
sal_Int32
(
nRight
)
-
sal_Int32
(
nLeft
))));
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"geoBottom"
,
OString
::
number
(
sal_Int32
(
nBottom
)
-
sal_Int32
(
nTop
))));
OString
::
number
(
sal_Int32
(
nBottom
)
-
sal_Int32
(
nTop
))));
}
break
;
case
ESCHER_Prop_pVertices
:
...
...
@@ -260,36 +270,36 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
EscherPropSortStruct
aVertices
;
EscherPropSortStruct
aSegments
;
if
(
rProps
.
GetOpt
(
ESCHER_Prop_pVertices
,
aVertices
)
&&
rProps
.
GetOpt
(
ESCHER_Prop_pSegmentInfo
,
aSegments
)
)
if
(
rProps
.
GetOpt
(
ESCHER_Prop_pVertices
,
aVertices
)
&&
rProps
.
GetOpt
(
ESCHER_Prop_pSegmentInfo
,
aSegments
)
)
{
const
sal_uInt8
*
pVerticesIt
=
aVertices
.
pBuf
+
6
;
const
sal_uInt8
*
pVerticesIt
=
aVertices
.
pBuf
+
6
;
sal_Size
nVerticesPos
=
6
;
const
sal_uInt8
*
pSegmentIt
=
aSegments
.
pBuf
;
const
sal_uInt8
*
pSegmentIt
=
aSegments
.
pBuf
;
OStringBuffer
aSegmentInfo
(
512
);
OStringBuffer
aVerticies
(
512
);
OStringBuffer
aSegmentInfo
(
512
);
OStringBuffer
aVerticies
(
512
);
sal_uInt16
nPointSize
=
aVertices
.
pBuf
[
4
]
+
(
aVertices
.
pBuf
[
5
]
<<
8
);
sal_uInt16
nPointSize
=
aVertices
.
pBuf
[
4
]
+
(
aVertices
.
pBuf
[
5
]
<<
8
);
// number of segments
sal_uInt16
nSegments
=
impl_GetUInt16
(
pSegmentIt
);
sal_uInt16
nSegments
=
impl_GetUInt16
(
pSegmentIt
);
sal_Int32
nVertices
=
0
;
aSegmentInfo
.
append
(
"2;"
).
append
((
sal_Int32
)
nSegments
);
pSegmentIt
+=
4
;
for
(
;
nSegments
;
--
nSegments
)
for
(;
nSegments
;
--
nSegments
)
{
sal_uInt16
nSeg
=
impl_GetUInt16
(
pSegmentIt
);
sal_uInt16
nSeg
=
impl_GetUInt16
(
pSegmentIt
);
aSegmentInfo
.
append
(
';'
).
append
((
sal_Int32
)
nSeg
);
switch
(
nSeg
)
switch
(
nSeg
)
{
case
0x0001
:
// lineto
case
0x4000
:
// moveto
{
sal_Int32
nX
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
sal_Int32
nY
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
aVerticies
.
append
(
";("
).
append
(
nX
).
append
(
","
).
append
(
nY
).
append
(
")"
);
sal_Int32
nX
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
sal_Int32
nY
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
aVerticies
.
append
(
";("
).
append
(
nX
).
append
(
","
).
append
(
nY
).
append
(
")"
);
nVertices
++
;
}
break
;
...
...
@@ -297,9 +307,9 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
sal_Int32
nX
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
sal_Int32
nY
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
aVerticies
.
append
(
";("
).
append
(
nX
).
append
(
","
).
append
(
nY
).
append
(
")"
);
sal_Int32
nX
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
sal_Int32
nY
=
impl_GetPointComponent
(
pVerticesIt
,
nVerticesPos
,
nPointSize
);
aVerticies
.
append
(
";("
).
append
(
nX
).
append
(
","
).
append
(
nY
).
append
(
")"
);
nVertices
++
;
}
}
...
...
@@ -326,12 +336,12 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
}
}
if
(
!
aVerticies
.
isEmpty
()
)
if
(
!
aVerticies
.
isEmpty
()
)
{
// We know the number of vertices at the end only, so we have to prepend them here.
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"pVerticies"
,
"8;"
+
OString
::
number
(
nVertices
)
+
aVerticies
.
makeStringAndClear
()));
}
if
(
!
aSegmentInfo
.
isEmpty
()
)
if
(
!
aSegmentInfo
.
isEmpty
()
)
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"pSegmentInfo"
,
aSegmentInfo
.
makeStringAndClear
()));
}
else
...
...
@@ -389,14 +399,14 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
}
}
void
RtfSdrExport
::
AddLineDimensions
(
const
Rectangle
&
rRectangle
)
void
RtfSdrExport
::
AddLineDimensions
(
const
Rectangle
&
rRectangle
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
// We get the position relative to (the current?) character
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"posrelh"
,
"3"
));
switch
(
m_nShapeFlags
&
0xC0
)
switch
(
m_nShapeFlags
&
0xC0
)
{
case
0x40
:
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"fFlipV"
,
"1"
));
...
...
@@ -417,7 +427,7 @@ void RtfSdrExport::AddLineDimensions( const Rectangle& rRectangle )
m_pShapeStyle
->
append
(
OOO_STRING_SVTOOLS_RTF_SHPBOTTOM
).
append
(
rRectangle
.
Bottom
());
}
void
RtfSdrExport
::
AddRectangleDimensions
(
OStringBuffer
&
rBuffer
,
const
Rectangle
&
rRectangle
)
void
RtfSdrExport
::
AddRectangleDimensions
(
OStringBuffer
&
rBuffer
,
const
Rectangle
&
rRectangle
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
...
...
@@ -432,7 +442,7 @@ void RtfSdrExport::AddRectangleDimensions( OStringBuffer& rBuffer, const Rectang
extern
const
char
*
pShapeTypes
[];
static
void
lcl_AppendSP
(
OStringBuffer
&
rRunText
,
const
char
cName
[],
const
OString
&
rValue
)
static
void
lcl_AppendSP
(
OStringBuffer
&
rRunText
,
const
char
cName
[],
const
OString
&
rValue
)
{
rRunText
.
append
(
'{'
).
append
(
OOO_STRING_SVTOOLS_RTF_SP
)
.
append
(
'{'
).
append
(
OOO_STRING_SVTOOLS_RTF_SN
" "
).
append
(
cName
).
append
(
'}'
)
...
...
@@ -483,7 +493,7 @@ sal_Int32 RtfSdrExport::StartShape()
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
if
(
m_nShapeType
==
ESCHER_ShpInst_Nil
)
if
(
m_nShapeType
==
ESCHER_ShpInst_Nil
)
return
-
1
;
m_aShapeProps
.
insert
(
std
::
pair
<
OString
,
OString
>
(
"shapeType"
,
OString
::
number
(
m_nShapeType
)));
...
...
@@ -499,11 +509,11 @@ sal_Int32 RtfSdrExport::StartShape()
// Ignore \shpbypage, \shpbymargin, and \shpbycolumn, in favor of the posrelh property.
m_rAttrOutput
.
RunText
().
append
(
OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE
);
for
(
std
::
map
<
OString
,
OString
>::
reverse_iterator
i
=
m_aShapeProps
.
rbegin
();
i
!=
m_aShapeProps
.
rend
();
++
i
)
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
(
*
i
).
first
.
getStr
(),
(
*
i
).
second
);
for
(
std
::
map
<
OString
,
OString
>::
reverse_iterator
i
=
m_aShapeProps
.
rbegin
();
i
!=
m_aShapeProps
.
rend
();
++
i
)
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
(
*
i
).
first
.
getStr
(),
(
*
i
).
second
);
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
"wzDescription"
,
msfilter
::
rtfutil
::
OutString
(
m_pSdrObject
->
GetDescription
(),
m_rExport
.
eCurrentEncoding
));
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
"wzName"
,
msfilter
::
rtfutil
::
OutString
(
m_pSdrObject
->
GetTitle
(),
m_rExport
.
eCurrentEncoding
));
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
"wzDescription"
,
msfilter
::
rtfutil
::
OutString
(
m_pSdrObject
->
GetDescription
(),
m_rExport
.
eCurrentEncoding
));
lcl_AppendSP
(
m_rAttrOutput
.
RunText
(),
"wzName"
,
msfilter
::
rtfutil
::
OutString
(
m_pSdrObject
->
GetTitle
(),
m_rExport
.
eCurrentEncoding
));
// now check if we have some text
const
SdrTextObj
*
pTxtObj
=
PTR_CAST
(
SdrTextObj
,
m_pSdrObject
);
...
...
@@ -527,11 +537,11 @@ sal_Int32 RtfSdrExport::StartShape()
pParaObj
=
pTxtObj
->
GetOutlinerParaObject
();
}
if
(
pParaObj
)
if
(
pParaObj
)
{
// this is reached only in case some text is attached to the shape
WriteOutliner
(
*
pParaObj
);
if
(
bOwnParaObj
)
if
(
bOwnParaObj
)
delete
pParaObj
;
}
}
...
...
@@ -544,36 +554,37 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj)
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
<<
" start"
);
const
EditTextObject
&
rEditObj
=
rParaObj
.
GetTextObject
();
MSWord_SdrAttrIter
aAttrIter
(
m_rExport
,
rEditObj
,
TXT_HFTXTBOX
);
MSWord_SdrAttrIter
aAttrIter
(
m_rExport
,
rEditObj
,
TXT_HFTXTBOX
);
sal_Int32
nPara
=
rEditObj
.
GetParagraphCount
();
m_rAttrOutput
.
RunText
().
append
(
'{'
).
append
(
OOO_STRING_SVTOOLS_RTF_SHPTXT
).
append
(
' '
);
for
(
sal_Int32
n
=
0
;
n
<
nPara
;
++
n
)
{
if
(
n
)
aAttrIter
.
NextPara
(
n
);
if
(
n
)
aAttrIter
.
NextPara
(
n
);
rtl_TextEncoding
eChrSet
=
aAttrIter
.
GetNodeCharSet
();
OUString
aStr
(
rEditObj
.
GetText
(
n
));
OUString
aStr
(
rEditObj
.
GetText
(
n
));
sal_Int32
nAktPos
=
0
;
const
sal_Int32
nEnd
=
aStr
.
getLength
();
aAttrIter
.
OutParaAttr
(
false
);
m_rAttrOutput
.
RunText
().
append
(
m_rAttrOutput
.
Styles
().
makeStringAndClear
());
do
{
do
{
const
sal_Int32
nNextAttr
=
std
::
min
(
aAttrIter
.
WhereNext
(),
nEnd
);
rtl_TextEncoding
eNextChrSet
=
aAttrIter
.
GetNextCharSet
();
aAttrIter
.
OutAttr
(
nAktPos
);
aAttrIter
.
OutAttr
(
nAktPos
);
m_rAttrOutput
.
RunText
().
append
(
'{'
).
append
(
m_rAttrOutput
.
Styles
().
makeStringAndClear
()).
append
(
SAL_NEWLINE_STRING
);
bool
bTxtAtr
=
aAttrIter
.
IsTxtAttr
(
nAktPos
);
if
(
!
bTxtAtr
)
bool
bTxtAtr
=
aAttrIter
.
IsTxtAttr
(
nAktPos
);
if
(
!
bTxtAtr
)
{
OUString
aOut
(
aStr
.
copy
(
nAktPos
,
nNextAttr
-
nAktPos
)
);
m_rAttrOutput
.
RunText
().
append
(
msfilter
::
rtfutil
::
OutString
(
aOut
,
eChrSet
)
);
OUString
aOut
(
aStr
.
copy
(
nAktPos
,
nNextAttr
-
nAktPos
)
);
m_rAttrOutput
.
RunText
().
append
(
msfilter
::
rtfutil
::
OutString
(
aOut
,
eChrSet
)
);
}
m_rAttrOutput
.
RunText
().
append
(
'}'
);
...
...
@@ -582,25 +593,25 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj)
eChrSet
=
eNextChrSet
;
aAttrIter
.
NextPos
();
}
while
(
nAktPos
<
nEnd
);
while
(
nAktPos
<
nEnd
);
}
m_rAttrOutput
.
RunText
().
append
(
OOO_STRING_SVTOOLS_RTF_PAR
).
append
(
'}'
);
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
<<
" end"
);
}
void
RtfSdrExport
::
EndShape
(
sal_Int32
nShapeElement
)
void
RtfSdrExport
::
EndShape
(
sal_Int32
nShapeElement
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
if
(
nShapeElement
>=
0
)
if
(
nShapeElement
>=
0
)
{
// end of the shape
m_rAttrOutput
.
RunText
().
append
(
'}'
).
append
(
'}'
);
}
}
sal_uInt32
RtfSdrExport
::
AddSdrObject
(
const
SdrObject
&
rObj
)
sal_uInt32
RtfSdrExport
::
AddSdrObject
(
const
SdrObject
&
rObj
)
{
m_pSdrObject
=
&
rObj
;
return
EscherEx
::
AddSdrObject
(
rObj
);
...
...
sw/source/filter/ww8/rtfsdrexport.hxx
Dosyayı görüntüle @
1a4d24b3
...
...
@@ -32,9 +32,9 @@ class RtfAttributeOutput;
/// Handles export of drawings using RTF markup
class
RtfSdrExport
:
public
EscherEx
{
RtfExport
&
m_rExport
;
RtfExport
&
m_rExport
;
RtfAttributeOutput
&
m_rAttrOutput
;
RtfAttributeOutput
&
m_rAttrOutput
;
const
SdrObject
*
m_pSdrObject
;
...
...
@@ -45,21 +45,21 @@ class RtfSdrExport : public EscherEx
sal_uInt32
m_nShapeFlags
;
/// Remember style, the most important shape attribute ;-)
OStringBuffer
*
m_pShapeStyle
;
OStringBuffer
*
m_pShapeStyle
;
std
::
map
<
OString
,
OString
>
m_aShapeProps
;
/// Remember which shape types we had already written.
bool
*
m_pShapeTypeWritten
;
bool
*
m_pShapeTypeWritten
;
public
:
RtfSdrExport
(
RtfExport
&
rExport
);
RtfSdrExport
(
RtfExport
&
rExport
);
virtual
~
RtfSdrExport
();
/// Export the sdr object as Sdr.
///
/// Call this when you need to export the object as Sdr in RTF.
sal_uInt32
AddSdrObject
(
const
SdrObject
&
rObj
);
sal_uInt32
AddSdrObject
(
const
SdrObject
&
rObj
);
protected
:
/// Start the shape for which we just collected the information.
...
...
@@ -72,26 +72,26 @@ protected:
///
/// The parameter is just what we got from StartShape().
using
EscherEx
::
EndShape
;
void
EndShape
(
sal_Int32
nShapeElement
);
void
EndShape
(
sal_Int32
nShapeElement
);
virtual
void
Commit
(
EscherPropertyContainer
&
rProps
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
virtual
void
Commit
(
EscherPropertyContainer
&
rProps
,
const
Rectangle
&
rRect
)
SAL_OVERRIDE
;
private
:
virtual
void
OpenContainer
(
sal_uInt16
nEscherContainer
,
int
nRecInstance
=
0
)
SAL_OVERRIDE
;
virtual
void
OpenContainer
(
sal_uInt16
nEscherContainer
,
int
nRecInstance
=
0
)
SAL_OVERRIDE
;
virtual
void
CloseContainer
()
SAL_OVERRIDE
;
virtual
sal_uInt32
EnterGroup
(
const
OUString
&
rShapeName
,
const
Rectangle
*
pBoundRect
=
0
)
SAL_OVERRIDE
;
virtual
sal_uInt32
EnterGroup
(
const
OUString
&
rShapeName
,
const
Rectangle
*
pBoundRect
=
0
)
SAL_OVERRIDE
;
virtual
void
LeaveGroup
()
SAL_OVERRIDE
;
virtual
void
AddShape
(
sal_uInt32
nShapeType
,
sal_uInt32
nShapeFlags
,
sal_uInt32
nShapeId
=
0
)
SAL_OVERRIDE
;
virtual
void
AddShape
(
sal_uInt32
nShapeType
,
sal_uInt32
nShapeFlags
,
sal_uInt32
nShapeId
=
0
)
SAL_OVERRIDE
;
private
:
/// Add starting and ending point of a line to the m_pShapeAttrList.
void
AddLineDimensions
(
const
Rectangle
&
rRectangle
);
void
AddLineDimensions
(
const
Rectangle
&
rRectangle
);
/// Add position and size to the OStringBuffer.
void
AddRectangleDimensions
(
OStringBuffer
&
rBuffer
,
const
Rectangle
&
rRectangle
);
void
AddRectangleDimensions
(
OStringBuffer
&
rBuffer
,
const
Rectangle
&
rRectangle
);
void
WriteOutliner
(
const
OutlinerParaObject
&
rParaObj
);
...
...
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