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
a468e386
Kaydet (Commit)
a468e386
authored
Şub 05, 2014
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
drawingML import: paragraph adjustment inside group shape
Change-Id: I875cb1f12c9f81d329d7fe9cd3aa32a4cd818573
üst
c53dd7ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
0 deletions
+46
-0
textparagraphproperties.hxx
include/oox/drawingml/textparagraphproperties.hxx
+4
-0
textbodycontext.cxx
oox/source/drawingml/textbodycontext.cxx
+1
-0
textparagraphpropertiescontext.cxx
oox/source/drawingml/textparagraphpropertiescontext.cxx
+21
-0
dml-groupshape-paraadjust.docx
sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx
+0
-0
ooxmlimport.cxx
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+20
-0
No files found.
include/oox/drawingml/textparagraphproperties.hxx
Dosyayı görüntüle @
a468e386
...
@@ -94,6 +94,9 @@ public:
...
@@ -94,6 +94,9 @@ public:
boost
::
optional
<
sal_Int32
>&
getParaLeftMargin
(){
return
moParaLeftMargin
;
}
boost
::
optional
<
sal_Int32
>&
getParaLeftMargin
(){
return
moParaLeftMargin
;
}
boost
::
optional
<
sal_Int32
>&
getFirstLineIndentation
(){
return
moFirstLineIndentation
;
}
boost
::
optional
<
sal_Int32
>&
getFirstLineIndentation
(){
return
moFirstLineIndentation
;
}
boost
::
optional
<
sal_Int16
>&
getParaAdjust
()
{
return
moParaAdjust
;
}
void
setParaAdjust
(
sal_Int16
nParaAdjust
)
{
moParaAdjust
=
nParaAdjust
;
}
void
apply
(
const
TextParagraphProperties
&
rSourceProps
);
void
apply
(
const
TextParagraphProperties
&
rSourceProps
);
void
pushToPropSet
(
const
::
oox
::
core
::
XmlFilterBase
*
pFilterBase
,
void
pushToPropSet
(
const
::
oox
::
core
::
XmlFilterBase
*
pFilterBase
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
&
xPropSet
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
&
xPropSet
,
...
@@ -118,6 +121,7 @@ protected:
...
@@ -118,6 +121,7 @@ protected:
TextSpacing
maParaBottomMargin
;
TextSpacing
maParaBottomMargin
;
boost
::
optional
<
sal_Int32
>
moParaLeftMargin
;
boost
::
optional
<
sal_Int32
>
moParaLeftMargin
;
boost
::
optional
<
sal_Int32
>
moFirstLineIndentation
;
boost
::
optional
<
sal_Int32
>
moFirstLineIndentation
;
boost
::
optional
<
sal_Int16
>
moParaAdjust
;
sal_Int16
mnLevel
;
sal_Int16
mnLevel
;
};
};
...
...
oox/source/drawingml/textbodycontext.cxx
Dosyayı görüntüle @
a468e386
...
@@ -83,6 +83,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
...
@@ -83,6 +83,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
return
new
TextFieldContext
(
*
this
,
rAttribs
,
*
pField
);
return
new
TextFieldContext
(
*
this
,
rAttribs
,
*
pField
);
}
}
case
A_TOKEN
(
pPr
):
case
A_TOKEN
(
pPr
):
case
OOX_TOKEN
(
doc
,
pPr
):
return
new
TextParagraphPropertiesContext
(
*
this
,
rAttribs
,
mrParagraph
.
getProperties
()
);
return
new
TextParagraphPropertiesContext
(
*
this
,
rAttribs
,
mrParagraph
.
getProperties
()
);
case
A_TOKEN
(
endParaRPr
):
case
A_TOKEN
(
endParaRPr
):
return
new
TextCharacterPropertiesContext
(
*
this
,
rAttribs
,
mrParagraph
.
getEndProperties
()
);
return
new
TextCharacterPropertiesContext
(
*
this
,
rAttribs
,
mrParagraph
.
getEndProperties
()
);
...
...
oox/source/drawingml/textparagraphpropertiescontext.cxx
Dosyayı görüntüle @
a468e386
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
...
@@ -153,6 +154,9 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
...
@@ -153,6 +154,9 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
sal_Int16
nLevel
=
mrTextParagraphProperties
.
getLevel
();
sal_Int16
nLevel
=
mrTextParagraphProperties
.
getLevel
();
rPropertyMap
[
PROP_NumberingLevel
]
<<=
nLevel
;
rPropertyMap
[
PROP_NumberingLevel
]
<<=
nLevel
;
rPropertyMap
[
PROP_NumberingIsNumber
]
<<=
sal_True
;
rPropertyMap
[
PROP_NumberingIsNumber
]
<<=
sal_True
;
if
(
mrTextParagraphProperties
.
getParaAdjust
()
)
rPropertyMap
[
PROP_ParaAdjust
]
<<=
mrTextParagraphProperties
.
getParaAdjust
().
get
();
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
...
@@ -238,6 +242,23 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
...
@@ -238,6 +242,23 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
return
new
TextTabStopListContext
(
*
this
,
maTabList
);
return
new
TextTabStopListContext
(
*
this
,
maTabList
);
case
A_TOKEN
(
defRPr
):
// CT_TextCharacterProperties
case
A_TOKEN
(
defRPr
):
// CT_TextCharacterProperties
return
new
TextCharacterPropertiesContext
(
*
this
,
rAttribs
,
mrTextParagraphProperties
.
getTextCharacterProperties
()
);
return
new
TextCharacterPropertiesContext
(
*
this
,
rAttribs
,
mrTextParagraphProperties
.
getTextCharacterProperties
()
);
case
OOX_TOKEN
(
doc
,
jc
):
{
OptValue
<
OUString
>
oParaAdjust
=
rAttribs
.
getString
(
OOX_TOKEN
(
doc
,
val
)
);
if
(
oParaAdjust
.
has
()
&&
!
oParaAdjust
.
get
().
isEmpty
()
)
{
const
OUString
&
sParaAdjust
=
oParaAdjust
.
get
();
if
(
sParaAdjust
==
"left"
)
mrTextParagraphProperties
.
setParaAdjust
(
ParagraphAdjust_LEFT
);
else
if
(
sParaAdjust
==
"right"
)
mrTextParagraphProperties
.
setParaAdjust
(
ParagraphAdjust_RIGHT
);
else
if
(
sParaAdjust
==
"center"
)
mrTextParagraphProperties
.
setParaAdjust
(
ParagraphAdjust_CENTER
);
else
if
(
sParaAdjust
==
"both"
)
mrTextParagraphProperties
.
setParaAdjust
(
ParagraphAdjust_BLOCK
);
}
}
break
;
}
}
return
this
;
return
this
;
}
}
...
...
sw/qa/extras/ooxmlimport/data/dml-groupshape-paraadjust.docx
0 → 100644
Dosyayı görüntüle @
a468e386
File added
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Dosyayı görüntüle @
a468e386
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <unotools/fltrcfg.hxx>
#include <unotools/fltrcfg.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/sequenceashashmap.hxx>
...
@@ -1788,6 +1789,25 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capita
...
@@ -1788,6 +1789,25 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capita
// 5th line has no capitalization
// 5th line has no capitalization
CPPUNIT_ASSERT_EQUAL
(
style
::
CaseMap
::
NONE
,
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
5
,
xText
),
1
),
"CharCaseMap"
));
CPPUNIT_ASSERT_EQUAL
(
style
::
CaseMap
::
NONE
,
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
5
,
xText
),
1
),
"CharCaseMap"
));
}
}
DECLARE_OOXMLIMPORT_TEST
(
testDMLGroupShapeParaAdjust
,
"dml-groupshape-paraadjust.docx"
)
{
// Paragraph adjustment inside a group shape was not imported
uno
::
Reference
<
container
::
XIndexAccess
>
xGroup
(
getShape
(
1
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
text
::
XText
>
xText
=
uno
::
Reference
<
text
::
XTextRange
>
(
xGroup
->
getByIndex
(
1
),
uno
::
UNO_QUERY
)
->
getText
();
// 2nd line is adjusted to the right
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_RIGHT
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
2
,
xText
),
1
),
"ParaAdjust"
));
// 3rd line has no adjustment
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_LEFT
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
3
,
xText
),
1
),
"ParaAdjust"
));
// 4th line is adjusted to center
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_CENTER
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
4
,
xText
),
1
),
"ParaAdjust"
));
// 5th line has no adjustment
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_LEFT
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
5
,
xText
),
1
),
"ParaAdjust"
));
// 6th line is justified
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_BLOCK
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
6
,
xText
),
1
),
"ParaAdjust"
));
// 7th line has no adjustment
CPPUNIT_ASSERT_EQUAL
(
sal_Int16
(
style
::
ParagraphAdjust_LEFT
),
getProperty
<
sal_Int16
>
(
getRun
(
getParagraphOfText
(
7
,
xText
),
1
),
"ParaAdjust"
));
}
#endif
#endif
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