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
4cbc41bc
Kaydet (Commit)
4cbc41bc
authored
Eyl 06, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bnc#779642 VML import: handle drawinglayer rectangle char spacing
Change-Id: I79fa72c9235682030d23a03fdb0c7c40370c4a8a
üst
870a2394
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
vmltextbox.hxx
include/oox/vml/vmltextbox.hxx
+1
-0
vmltextbox.cxx
oox/source/vml/vmltextbox.cxx
+10
-0
vmltextboxcontext.cxx
oox/source/vml/vmltextboxcontext.cxx
+10
-0
groupshape-sdt.docx
sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx
+0
-0
ooxmlimport.cxx
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+16
-0
No files found.
include/oox/vml/vmltextbox.hxx
Dosyayı görüntüle @
4cbc41bc
...
@@ -54,6 +54,7 @@ struct OOX_DLLPUBLIC TextFontModel
...
@@ -54,6 +54,7 @@ struct OOX_DLLPUBLIC TextFontModel
OptValue
<
bool
>
mobBold
;
OptValue
<
bool
>
mobBold
;
OptValue
<
bool
>
mobItalic
;
OptValue
<
bool
>
mobItalic
;
OptValue
<
bool
>
mobStrikeout
;
OptValue
<
bool
>
mobStrikeout
;
OptValue
<
sal_Int32
>
monSpacing
;
explicit
TextFontModel
();
explicit
TextFontModel
();
};
};
...
...
oox/source/vml/vmltextbox.cxx
Dosyayı görüntüle @
4cbc41bc
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "oox/vml/vmltextbox.hxx"
#include "oox/vml/vmltextbox.hxx"
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <svx/unopage.hxx>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
...
@@ -92,6 +93,15 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
...
@@ -92,6 +93,15 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
aPropertyValue
.
Value
=
uno
::
makeAny
(
double
(
rFont
.
monSize
.
get
())
/
2.
);
aPropertyValue
.
Value
=
uno
::
makeAny
(
double
(
rFont
.
monSize
.
get
())
/
2.
);
aPropVec
.
push_back
(
aPropertyValue
);
aPropVec
.
push_back
(
aPropertyValue
);
}
}
if
(
rFont
.
monSpacing
.
has
())
{
aPropertyValue
.
Name
=
"CharKerning"
;
// Value is not converted to mm100: SvxKerningItem::PutValue() gets
// called with nMemberId = 0, so no mm100 -> twips conversion will
// be done there.
aPropertyValue
.
Value
=
uno
::
makeAny
(
sal_Int16
(
rFont
.
monSpacing
.
get
()));
aPropVec
.
push_back
(
aPropertyValue
);
}
if
(
rParagraph
.
moParaAdjust
.
has
())
if
(
rParagraph
.
moParaAdjust
.
has
())
{
{
style
::
ParagraphAdjust
eAdjust
=
style
::
ParagraphAdjust_LEFT
;
style
::
ParagraphAdjust
eAdjust
=
style
::
ParagraphAdjust_LEFT
;
...
...
oox/source/vml/vmltextboxcontext.cxx
Dosyayı görüntüle @
4cbc41bc
...
@@ -132,6 +132,16 @@ void TextPortionContext::onStartElement(const AttributeList& rAttribs)
...
@@ -132,6 +132,16 @@ void TextPortionContext::onStartElement(const AttributeList& rAttribs)
case
OOX_TOKEN
(
doc
,
color
):
case
OOX_TOKEN
(
doc
,
color
):
maFont
.
moColor
=
rAttribs
.
getString
(
OOX_TOKEN
(
doc
,
val
)
);
maFont
.
moColor
=
rAttribs
.
getString
(
OOX_TOKEN
(
doc
,
val
)
);
break
;
break
;
case
OOX_TOKEN
(
doc
,
spacing
):
maFont
.
monSpacing
=
rAttribs
.
getInteger
(
OOX_TOKEN
(
doc
,
val
));
break
;
case
OOX_TOKEN
(
doc
,
r
):
case
OOX_TOKEN
(
doc
,
rPr
):
case
OOX_TOKEN
(
doc
,
t
):
break
;
default
:
SAL_INFO
(
"oox"
,
"unhandled: 0x"
<<
std
::
hex
<<
getCurrentElement
());
break
;
}
}
}
}
...
...
sw/qa/extras/ooxmlimport/data/groupshape-sdt.docx
0 → 100755
Dosyayı görüntüle @
4cbc41bc
File added
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Dosyayı görüntüle @
4cbc41bc
...
@@ -132,6 +132,7 @@ public:
...
@@ -132,6 +132,7 @@ public:
void
testTablePagebreak
();
void
testTablePagebreak
();
void
testFdo68607
();
void
testFdo68607
();
void
testVmlTextVerticalAdjust
();
void
testVmlTextVerticalAdjust
();
void
testGroupshapeSdt
();
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
#if !defined(MACOSX) && !defined(WNT)
...
@@ -230,6 +231,7 @@ void Test::run()
...
@@ -230,6 +231,7 @@ void Test::run()
{
"table-pagebreak.docx"
,
&
Test
::
testTablePagebreak
},
{
"table-pagebreak.docx"
,
&
Test
::
testTablePagebreak
},
{
"fdo68607.docx"
,
&
Test
::
testFdo68607
},
{
"fdo68607.docx"
,
&
Test
::
testFdo68607
},
{
"vml-text-vertical-adjust.docx"
,
&
Test
::
testVmlTextVerticalAdjust
},
{
"vml-text-vertical-adjust.docx"
,
&
Test
::
testVmlTextVerticalAdjust
},
{
"groupshape-sdt.docx"
,
&
Test
::
testGroupshapeSdt
},
};
};
header
();
header
();
for
(
unsigned
int
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aMethods
);
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aMethods
);
++
i
)
...
@@ -1551,6 +1553,20 @@ void Test::testVmlTextVerticalAdjust()
...
@@ -1551,6 +1553,20 @@ void Test::testVmlTextVerticalAdjust()
CPPUNIT_ASSERT_EQUAL
(
drawing
::
TextVerticalAdjust_TOP
,
getProperty
<
drawing
::
TextVerticalAdjust
>
(
xShape
,
"TextVerticalAdjust"
));
CPPUNIT_ASSERT_EQUAL
(
drawing
::
TextVerticalAdjust_TOP
,
getProperty
<
drawing
::
TextVerticalAdjust
>
(
xShape
,
"TextVerticalAdjust"
));
}
}
void
Test
::
testGroupshapeSdt
()
{
// All problems here are due to the groupshape: we have a drawinglayer rectangle, not a writer textframe.
uno
::
Reference
<
drawing
::
XShapes
>
xOuterGroupShape
(
getShape
(
1
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
drawing
::
XShapes
>
xInnerGroupShape
(
xOuterGroupShape
->
getByIndex
(
0
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
text
::
XTextRange
>
xShape
(
xInnerGroupShape
->
getByIndex
(
0
),
uno
::
UNO_QUERY
);
// Border distances were not implemented, this was 0.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
1905
),
getProperty
<
sal_Int32
>
(
xShape
,
"TextUpperDistance"
));
// Sdt field result wasn't imported, this was "".
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"placeholder text"
),
xShape
->
getString
());
// w:spacing was ignored in oox, this was 0.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
20
),
getProperty
<
sal_Int32
>
(
getRun
(
getParagraphOfText
(
1
,
xShape
->
getText
()),
1
),
"CharKerning"
));
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
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