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
7fe05dc9
Kaydet (Commit)
7fe05dc9
authored
Agu 29, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add SimpleShape::createPictureObject to avoid code duplication
Change-Id: Id4bb0550ab2ce9bbb7edf568a086be18c1576b33
üst
9f6dd9a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
38 deletions
+36
-38
vmlshape.hxx
oox/inc/oox/vml/vmlshape.hxx
+4
-0
vmlshape.cxx
oox/source/vml/vmlshape.cxx
+32
-38
No files found.
oox/inc/oox/vml/vmlshape.hxx
Dosyayı görüntüle @
7fe05dc9
...
...
@@ -272,6 +272,10 @@ protected:
implConvertAndInsert
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
drawing
::
XShapes
>&
rxShapes
,
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rShapeRect
)
const
;
/** Used by both RectangleShape and ComplexShape. */
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
drawing
::
XShape
>
createPictureObject
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
drawing
::
XShapes
>&
rxShapes
,
const
com
::
sun
::
star
::
awt
::
Rectangle
&
rShapeRect
,
OUString
&
rGraphicPath
)
const
;
private
:
::
rtl
::
OUString
maService
;
///< Name of the UNO shape service.
...
...
oox/source/vml/vmlshape.cxx
Dosyayı görüntüle @
7fe05dc9
...
...
@@ -447,6 +447,36 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
return
xShape
;
}
Reference
<
XShape
>
SimpleShape
::
createPictureObject
(
const
Reference
<
XShapes
>&
rxShapes
,
const
Rectangle
&
rShapeRect
,
OUString
&
rGraphicPath
)
const
{
Reference
<
XShape
>
xShape
=
mrDrawing
.
createAndInsertXShape
(
"com.sun.star.drawing.GraphicObjectShape"
,
rxShapes
,
rShapeRect
);
if
(
xShape
.
is
()
)
{
XmlFilterBase
&
rFilter
=
mrDrawing
.
getFilter
();
OUString
aGraphicUrl
=
rFilter
.
getGraphicHelper
().
importEmbeddedGraphicObject
(
rGraphicPath
);
PropertySet
aPropSet
(
xShape
);
if
(
!
aGraphicUrl
.
isEmpty
()
)
{
aPropSet
.
setProperty
(
PROP_GraphicURL
,
aGraphicUrl
);
}
// If the shape has an absolute position, set the properties accordingly.
if
(
maTypeModel
.
maPosition
==
"absolute"
)
{
aPropSet
.
setProperty
(
PROP_HoriOrientPosition
,
rShapeRect
.
X
);
aPropSet
.
setProperty
(
PROP_VertOrientPosition
,
rShapeRect
.
Y
);
aPropSet
.
setProperty
(
PROP_Opaque
,
sal_False
);
}
lcl_SetAnchorType
(
aPropSet
,
maTypeModel
);
if
(
maTypeModel
.
maPositionVerticalRelative
==
"page"
)
{
aPropSet
.
setProperty
(
PROP_VertOrientRelation
,
text
::
RelOrientation
::
PAGE_FRAME
);
}
}
return
xShape
;
}
// ============================================================================
RectangleShape
::
RectangleShape
(
Drawing
&
rDrawing
)
:
...
...
@@ -456,21 +486,11 @@ RectangleShape::RectangleShape( Drawing& rDrawing ) :
Reference
<
XShape
>
RectangleShape
::
implConvertAndInsert
(
const
Reference
<
XShapes
>&
rxShapes
,
const
Rectangle
&
rShapeRect
)
const
{
XmlFilterBase
&
rFilter
=
mrDrawing
.
getFilter
();
OUString
aGraphicPath
=
getGraphicPath
();
// try to create a picture object
if
(
!
aGraphicPath
.
isEmpty
())
{
Reference
<
XShape
>
xShape
=
mrDrawing
.
createAndInsertXShape
(
"com.sun.star.drawing.GraphicObjectShape"
,
rxShapes
,
rShapeRect
);
if
(
xShape
.
is
())
{
OUString
aGraphicUrl
=
rFilter
.
getGraphicHelper
().
importEmbeddedGraphicObject
(
aGraphicPath
);
PropertySet
aPropSet
(
xShape
);
aPropSet
.
setProperty
(
PROP_GraphicURL
,
aGraphicUrl
);
}
return
xShape
;
}
return
SimpleShape
::
createPictureObject
(
rxShapes
,
rShapeRect
,
aGraphicPath
);
// default: try to create a rectangle shape
return
SimpleShape
::
implConvertAndInsert
(
rxShapes
,
rShapeRect
);
...
...
@@ -632,33 +652,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
// try to create a picture object
if
(
!
aGraphicPath
.
isEmpty
()
)
{
Reference
<
XShape
>
xShape
=
mrDrawing
.
createAndInsertXShape
(
CREATE_OUSTRING
(
"com.sun.star.drawing.GraphicObjectShape"
),
rxShapes
,
rShapeRect
);
if
(
xShape
.
is
()
)
{
OUString
aGraphicUrl
=
rFilter
.
getGraphicHelper
().
importEmbeddedGraphicObject
(
aGraphicPath
);
PropertySet
aPropSet
(
xShape
);
if
(
!
aGraphicUrl
.
isEmpty
()
)
{
aPropSet
.
setProperty
(
PROP_GraphicURL
,
aGraphicUrl
);
}
// If the shape has an absolute position, set the properties accordingly.
if
(
maTypeModel
.
maPosition
==
"absolute"
)
{
aPropSet
.
setProperty
(
PROP_HoriOrientPosition
,
rShapeRect
.
X
);
aPropSet
.
setProperty
(
PROP_VertOrientPosition
,
rShapeRect
.
Y
);
aPropSet
.
setProperty
(
PROP_Opaque
,
sal_False
);
}
lcl_SetAnchorType
(
aPropSet
,
maTypeModel
);
if
(
maTypeModel
.
maPositionVerticalRelative
==
"page"
)
{
aPropSet
.
setProperty
(
PROP_VertOrientRelation
,
text
::
RelOrientation
::
PAGE_FRAME
);
}
}
return
xShape
;
}
return
SimpleShape
::
createPictureObject
(
rxShapes
,
rShapeRect
,
aGraphicPath
);
// default: try to create a custom shape
return
CustomShape
::
implConvertAndInsert
(
rxShapes
,
rShapeRect
);
...
...
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