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
8167b8f3
Kaydet (Commit)
8167b8f3
authored
Şub 14, 2012
tarafından
Muthu Subramanian
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
n744510: Improved 'vert' text imports.
üst
cc459ea8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
37 deletions
+48
-37
textbodyproperties.hxx
oox/inc/oox/drawingml/textbodyproperties.hxx
+6
-3
shape.cxx
oox/source/drawingml/shape.cxx
+4
-2
textbodyproperties.cxx
oox/source/drawingml/textbodyproperties.cxx
+30
-2
textbodypropertiescontext.cxx
oox/source/drawingml/textbodypropertiescontext.cxx
+8
-30
No files found.
oox/inc/oox/drawingml/textbodyproperties.hxx
Dosyayı görüntüle @
8167b8f3
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#ifndef OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
#ifndef OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
#define OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
#define OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include "oox/helper/helper.hxx"
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertymap.hxx"
...
@@ -39,13 +40,15 @@ namespace drawingml {
...
@@ -39,13 +40,15 @@ namespace drawingml {
struct
TextBodyProperties
struct
TextBodyProperties
{
{
PropertyMap
maPropertyMap
;
PropertyMap
maPropertyMap
;
OptValue
<
sal_Int32
>
moRotation
;
OptValue
<
sal_Int32
>
moRotation
;
OptValue
<
sal_Int32
>
moVert
;
OptValue
<
sal_Int32
>
moVert
;
::
com
::
sun
::
star
::
drawing
::
TextVerticalAdjust
meVA
;
explicit
TextBodyProperties
();
explicit
TextBodyProperties
();
void
pushToPropMap
(
PropertyMap
&
rPropMap
)
const
;
void
pushToPropMap
(
PropertyMap
&
rPropMap
)
const
;
void
pushVertSimulation
();
};
};
// ============================================================================
// ============================================================================
...
...
oox/source/drawingml/shape.cxx
Dosyayı görüntüle @
8167b8f3
...
@@ -528,15 +528,17 @@ Reference< XShape > Shape::createAndInsert(
...
@@ -528,15 +528,17 @@ Reference< XShape > Shape::createAndInsert(
mpCustomShapePropertiesPtr
->
setMirroredX
(
sal_True
);
mpCustomShapePropertiesPtr
->
setMirroredX
(
sal_True
);
if
(
mbFlipV
)
if
(
mbFlipV
)
mpCustomShapePropertiesPtr
->
setMirroredY
(
sal_True
);
mpCustomShapePropertiesPtr
->
setMirroredY
(
sal_True
);
if
(
mpTextBody
.
get
()
)
if
(
getTextBody
()
)
{
{
sal_Int32
nTextRotateAngle
=
static_cast
<
sal_Int32
>
(
mpTextBody
->
getTextProperties
().
moRotation
.
get
(
0
)
);
sal_Int32
nTextRotateAngle
=
static_cast
<
sal_Int32
>
(
getTextBody
()
->
getTextProperties
().
moRotation
.
get
(
0
)
);
mpCustomShapePropertiesPtr
->
setTextRotateAngle
(
-
nTextRotateAngle
/
60000
);
mpCustomShapePropertiesPtr
->
setTextRotateAngle
(
-
nTextRotateAngle
/
60000
);
}
}
OSL_TRACE
(
"==cscode== shape name: '%s'"
,
rtl
::
OUStringToOString
(
msName
,
RTL_TEXTENCODING_UTF8
).
getStr
());
OSL_TRACE
(
"==cscode== shape name: '%s'"
,
rtl
::
OUStringToOString
(
msName
,
RTL_TEXTENCODING_UTF8
).
getStr
());
mpCustomShapePropertiesPtr
->
pushToPropSet
(
rFilterBase
,
xSet
,
mxShape
);
mpCustomShapePropertiesPtr
->
pushToPropSet
(
rFilterBase
,
xSet
,
mxShape
);
}
}
else
if
(
getTextBody
()
)
getTextBody
()
->
getTextProperties
().
pushVertSimulation
();
// in some cases, we don't have any text body.
// in some cases, we don't have any text body.
if
(
getTextBody
()
)
if
(
getTextBody
()
)
...
...
oox/source/drawingml/textbodyproperties.cxx
Dosyayı görüntüle @
8167b8f3
...
@@ -26,16 +26,22 @@
...
@@ -26,16 +26,22 @@
*
*
************************************************************************/
************************************************************************/
#include "oox/drawingml/textbodyproperties.hxx"
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/token/tokens.hxx"
#include "oox/token/tokens.hxx"
using
namespace
::
com
::
sun
::
star
::
drawing
;
using
namespace
::
com
::
sun
::
star
::
text
;
namespace
oox
{
namespace
oox
{
namespace
drawingml
{
namespace
drawingml
{
// ============================================================================
// ============================================================================
TextBodyProperties
::
TextBodyProperties
()
TextBodyProperties
::
TextBodyProperties
()
:
meVA
(
TextVerticalAdjust_TOP
)
{
{
}
}
...
@@ -44,6 +50,28 @@ void TextBodyProperties::pushToPropMap( PropertyMap& rPropMap ) const
...
@@ -44,6 +50,28 @@ void TextBodyProperties::pushToPropMap( PropertyMap& rPropMap ) const
rPropMap
.
insert
(
maPropertyMap
.
begin
(),
maPropertyMap
.
end
()
);
rPropMap
.
insert
(
maPropertyMap
.
begin
(),
maPropertyMap
.
end
()
);
}
}
/* For Legacy purposes: TODO: Check if it is required at all! */
void
TextBodyProperties
::
pushVertSimulation
()
{
sal_Int32
tVert
=
moVert
.
get
(
XML_horz
);
if
(
tVert
==
XML_vert
||
tVert
==
XML_eaVert
||
tVert
==
XML_vert270
||
tVert
==
XML_mongolianVert
)
{
// #160799# fake different vertical text modes by top-bottom writing mode
maPropertyMap
[
PROP_TextWritingMode
]
<<=
WritingMode_TB_RL
;
// workaround for TB_LR as using WritingMode2 doesn't work
if
(
meVA
!=
TextVerticalAdjust_CENTER
)
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
(
tVert
==
XML_vert270
)
?
TextHorizontalAdjust_RIGHT
:
TextHorizontalAdjust_LEFT
;
if
(
tVert
==
XML_vert270
)
maPropertyMap
[
PROP_TextVerticalAdjust
]
<<=
TextVerticalAdjust_BOTTOM
;
if
(
(
tVert
==
XML_vert
&&
meVA
==
TextVerticalAdjust_TOP
)
||
(
tVert
==
XML_vert270
&&
meVA
==
TextVerticalAdjust_BOTTOM
)
)
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
TextHorizontalAdjust_RIGHT
;
else
if
(
meVA
==
TextVerticalAdjust_CENTER
)
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
TextHorizontalAdjust_CENTER
;
}
}
// ============================================================================
// ============================================================================
}
// namespace drawingml
}
// namespace drawingml
...
...
oox/source/drawingml/textbodypropertiescontext.cxx
Dosyayı görüntüle @
8167b8f3
...
@@ -28,12 +28,10 @@
...
@@ -28,12 +28,10 @@
#include "oox/drawingml/textbodypropertiescontext.hxx"
#include "oox/drawingml/textbodypropertiescontext.hxx"
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
//#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/attributelist.hxx"
...
@@ -118,45 +116,25 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
...
@@ -118,45 +116,25 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
mrTextBodyProp
.
moVert
=
aAttribs
.
getToken
(
XML_vert
);
mrTextBodyProp
.
moVert
=
aAttribs
.
getToken
(
XML_vert
);
bool
bRtl
=
aAttribs
.
getBool
(
XML_rtl
,
false
);
bool
bRtl
=
aAttribs
.
getBool
(
XML_rtl
,
false
);
sal_Int32
tVert
=
mrTextBodyProp
.
moVert
.
get
(
XML_horz
);
sal_Int32
tVert
=
mrTextBodyProp
.
moVert
.
get
(
XML_horz
);
if
(
tVert
==
XML_vert
||
tVert
==
XML_eaVert
||
tVert
==
XML_vert270
||
tVert
==
XML_mongolianVert
)
{
if
(
tVert
==
XML_vert
||
tVert
==
XML_eaVert
||
tVert
==
XML_vert270
||
tVert
==
XML_mongolianVert
)
// #160799# fake different vertical text modes by top-bottom writing mode
mrTextBodyProp
.
moRotation
=
5400000
*
(
tVert
==
XML_vert270
?
3
:
1
);
mrTextBodyProp
.
maPropertyMap
[
PROP_TextWritingMode
]
else
<<=
WritingMode_TB_RL
;
// workaround for TB_LR as using WritingMode2 doesn't work
if
(
!
bAnchorCenter
)
mrTextBodyProp
.
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
(
tVert
==
XML_vert270
)
?
TextHorizontalAdjust_RIGHT
:
TextHorizontalAdjust_LEFT
;
// Default for vert270
if
(
tVert
==
XML_vert270
)
mrTextBodyProp
.
maPropertyMap
[
PROP_TextVerticalAdjust
]
<<=
drawing
::
TextVerticalAdjust_BOTTOM
;
}
else
mrTextBodyProp
.
maPropertyMap
[
PROP_TextWritingMode
]
mrTextBodyProp
.
maPropertyMap
[
PROP_TextWritingMode
]
<<=
(
bRtl
?
WritingMode_RL_TB
:
WritingMode_LR_TB
);
<<=
(
bRtl
?
WritingMode_RL_TB
:
WritingMode_LR_TB
);
}
}
// ST_TextAnchoringType
// ST_TextAnchoringType
if
(
xAttributes
->
hasAttribute
(
XML_anchor
)
)
{
if
(
xAttributes
->
hasAttribute
(
XML_anchor
)
)
{
drawing
::
TextVerticalAdjust
eVA
(
drawing
::
TextVerticalAdjust_TOP
);
switch
(
xAttributes
->
getOptionalValueToken
(
XML_anchor
,
XML_t
)
)
switch
(
xAttributes
->
getOptionalValueToken
(
XML_anchor
,
XML_t
)
)
{
{
case
XML_b
:
eVA
=
drawing
::
TextVerticalAdjust_BOTTOM
;
break
;
case
XML_b
:
mrTextBodyProp
.
m
eVA
=
drawing
::
TextVerticalAdjust_BOTTOM
;
break
;
case
XML_dist
:
case
XML_dist
:
case
XML_just
:
case
XML_just
:
case
XML_ctr
:
eVA
=
drawing
::
TextVerticalAdjust_CENTER
;
break
;
case
XML_ctr
:
mrTextBodyProp
.
m
eVA
=
drawing
::
TextVerticalAdjust_CENTER
;
break
;
default
:
default
:
case
XML_t
:
eVA
=
drawing
::
TextVerticalAdjust_TOP
;
break
;
case
XML_t
:
mrTextBodyProp
.
meVA
=
drawing
::
TextVerticalAdjust_TOP
;
break
;
}
if
(
xAttributes
->
hasAttribute
(
XML_vert
)
&&
(
(
mrTextBodyProp
.
moVert
.
get
(
XML_horz
)
==
XML_vert
&&
eVA
==
drawing
::
TextVerticalAdjust_TOP
)
||
(
mrTextBodyProp
.
moVert
.
get
(
XML_horz
)
==
XML_vert270
&&
eVA
==
drawing
::
TextVerticalAdjust_BOTTOM
)
)
)
{
mrTextBodyProp
.
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
TextHorizontalAdjust_RIGHT
;
}
}
else
if
(
mrTextBodyProp
.
moVert
.
get
(
XML_horz
)
==
XML_horz
)
mrTextBodyProp
.
maPropertyMap
[
PROP_TextVerticalAdjust
]
<<=
mrTextBodyProp
.
meVA
;
mrTextBodyProp
.
maPropertyMap
[
PROP_TextVerticalAdjust
]
<<=
eVA
;
else
if
(
eVA
==
drawing
::
TextVerticalAdjust_CENTER
&&
xAttributes
->
hasAttribute
(
XML_vert
)
)
mrTextBodyProp
.
maPropertyMap
[
PROP_TextHorizontalAdjust
]
<<=
TextHorizontalAdjust_CENTER
;
}
}
}
}
...
...
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