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
eb5f2df4
Kaydet (Commit)
eb5f2df4
authored
Nis 26, 2012
tarafından
Muthu Subramanian
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
n758565: Wrong master slide shape being used.
* Changed <ph> idx to OptValue. * Duplicate code removal.
üst
a3b8ddf3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
65 deletions
+32
-65
shape.hxx
oox/inc/oox/drawingml/shape.hxx
+3
-3
helper.hxx
oox/inc/oox/helper/helper.hxx
+4
-0
shape.cxx
oox/source/drawingml/shape.cxx
+1
-2
pptgraphicshapecontext.cxx
oox/source/ppt/pptgraphicshapecontext.cxx
+4
-44
pptshape.cxx
oox/source/ppt/pptshape.cxx
+5
-8
pptshapecontext.cxx
oox/source/ppt/pptshapecontext.cxx
+15
-8
No files found.
oox/inc/oox/drawingml/shape.hxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -130,8 +130,8 @@ public:
void
setHiddenMasterShape
(
sal_Bool
bHiddenMasterShape
)
{
mbHiddenMasterShape
=
bHiddenMasterShape
;
}
void
setSubType
(
sal_Int32
nSubType
)
{
mnSubType
=
nSubType
;
}
sal_Int32
getSubType
()
const
{
return
mnSubType
;
}
void
setSubTypeIndex
(
sal_
uInt32
nSubTypeIndex
)
{
mn
SubTypeIndex
=
nSubTypeIndex
;
}
sal_Int32
getSubTypeIndex
()
const
{
return
mn
SubTypeIndex
;
}
void
setSubTypeIndex
(
sal_
Int32
nSubTypeIndex
)
{
mo
SubTypeIndex
=
nSubTypeIndex
;
}
const
OptValue
<
sal_Int32
>&
getSubTypeIndex
()
const
{
return
mo
SubTypeIndex
;
}
// setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
void
setDefaults
();
...
...
@@ -232,7 +232,7 @@ protected:
rtl
::
OUString
msName
;
rtl
::
OUString
msId
;
sal_Int32
mnSubType
;
// if this type is not zero, then the shape is a placeholder
sal_Int32
mn
SubTypeIndex
;
OptValue
<
sal_Int32
>
mo
SubTypeIndex
;
ShapeStyleRefMap
maShapeStyleRefs
;
...
...
oox/inc/oox/helper/helper.hxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -219,6 +219,10 @@ public:
inline
Type
&
use
()
{
mbHasValue
=
true
;
return
maValue
;
}
inline
OptValue
&
operator
=
(
const
Type
&
rValue
)
{
set
(
rValue
);
return
*
this
;
}
inline
bool
operator
==
(
const
OptValue
&
rValue
)
const
{
return
(
(
mbHasValue
==
false
&&
rValue
.
mbHasValue
==
false
)
||
(
mbHasValue
==
rValue
.
mbHasValue
&&
maValue
==
rValue
.
maValue
)
);
}
inline
void
assignIfUsed
(
const
OptValue
&
rValue
)
{
if
(
rValue
.
mbHasValue
)
set
(
rValue
.
maValue
);
}
private
:
...
...
oox/source/drawingml/shape.cxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -84,7 +84,6 @@ Shape::Shape( const sal_Char* pServiceName )
,
mpCustomShapePropertiesPtr
(
new
CustomShapeProperties
)
,
mpMasterTextListStyle
(
new
TextListStyle
)
,
mnSubType
(
0
)
,
mnSubTypeIndex
(
-
1
)
,
meFrameType
(
FRAMETYPE_GENERIC
)
,
mnRotation
(
0
)
,
mbFlipH
(
false
)
...
...
@@ -114,7 +113,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
,
msName
(
pSourceShape
->
msName
)
,
msId
(
pSourceShape
->
msId
)
,
mnSubType
(
pSourceShape
->
mnSubType
)
,
m
nSubTypeIndex
(
pSourceShape
->
mn
SubTypeIndex
)
,
m
oSubTypeIndex
(
pSourceShape
->
mo
SubTypeIndex
)
,
maShapeStyleRefs
(
pSourceShape
->
maShapeStyleRefs
)
,
maSize
(
pSourceShape
->
maSize
)
,
maPosition
(
pSourceShape
->
maPosition
)
...
...
oox/source/ppt/pptgraphicshapecontext.cxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -63,51 +63,11 @@ PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler& rParent, const S
{
}
static
oox
::
drawingml
::
ShapePtr
findPlaceholder
(
const
sal_Int32
nMasterPlaceholder
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
{
oox
::
drawingml
::
ShapePtr
aShapePtr
;
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>::
reverse_iterator
aRevIter
(
rShapes
.
rbegin
()
);
while
(
aRevIter
!=
rShapes
.
rend
()
)
{
if
(
(
*
aRevIter
)
->
getSubType
()
==
nMasterPlaceholder
)
{
aShapePtr
=
*
aRevIter
;
break
;
}
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rChildren
=
(
*
aRevIter
)
->
getChildren
();
aShapePtr
=
findPlaceholder
(
nMasterPlaceholder
,
rChildren
);
if
(
aShapePtr
.
get
()
)
break
;
++
aRevIter
;
}
return
aShapePtr
;
}
static
oox
::
drawingml
::
ShapePtr
findPlaceholderByIndex
(
const
sal_Int32
nIdx
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
{
oox
::
drawingml
::
ShapePtr
aShapePtr
;
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>::
reverse_iterator
aRevIter
(
rShapes
.
rbegin
()
);
while
(
aRevIter
!=
rShapes
.
rend
()
)
{
if
(
(
*
aRevIter
)
->
getSubTypeIndex
()
==
nIdx
)
{
aShapePtr
=
*
aRevIter
;
break
;
}
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rChildren
=
(
*
aRevIter
)
->
getChildren
();
aShapePtr
=
findPlaceholderByIndex
(
nIdx
,
rChildren
);
if
(
aShapePtr
.
get
()
)
break
;
++
aRevIter
;
}
return
aShapePtr
;
}
// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
static
oox
::
drawingml
::
ShapePtr
findPlaceholder
(
sal_Int32
nFirstPlaceholder
,
sal_Int32
nSecondPlaceholder
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
{
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
findPlaceholder
(
nFirstPlaceholder
,
rShapes
);
return
!
nSecondPlaceholder
||
pPlaceholder
.
get
()
?
pPlaceholder
:
findPlaceholder
(
nSecondPlaceholder
,
rShapes
);
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
PPTShape
::
findPlaceholder
(
nFirstPlaceholder
,
rShapes
);
return
!
nSecondPlaceholder
||
pPlaceholder
.
get
()
?
pPlaceholder
:
PPTShape
::
findPlaceholder
(
nSecondPlaceholder
,
rShapes
);
}
Reference
<
XFastContextHandler
>
PPTGraphicShapeContext
::
createFastChildContext
(
sal_Int32
aElementToken
,
const
Reference
<
XFastAttributeList
>&
xAttribs
)
throw
(
SAXException
,
RuntimeException
)
...
...
@@ -145,8 +105,8 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext(
{
// TODO: use id to shape map
SlidePersistPtr
pMasterPersist
(
mpSlidePersistPtr
->
getMasterPersist
()
);
if
(
pMasterPersist
.
get
()
)
pPlaceholder
=
findPlaceholderByIndex
(
nIdx
,
pMasterPersist
->
getShapes
()
->
getChildren
()
);
if
(
pMasterPersist
.
get
()
&&
xAttribs
->
hasAttribute
(
XML_idx
)
)
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
nIdx
,
pMasterPersist
->
getShapes
()
->
getChildren
()
);
}
if
(
!
pPlaceholder
.
get
()
&&
(
(
eShapeLocation
==
Slide
)
||
(
eShapeLocation
==
Layout
)
)
)
{
...
...
oox/source/ppt/pptshape.cxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -262,10 +262,10 @@ void PPTShape::addShape(
OSL_TRACE
(
"shape service: %s"
,
rtl
::
OUStringToOString
(
sServiceName
,
RTL_TEXTENCODING_UTF8
).
getStr
());
// use placeholder index if possible
if
(
mnSubType
&&
getSubTypeIndex
()
&&
getSubTypeIndex
()
!=
-
1
&&
rSlidePersist
.
getMasterPersist
().
get
()
)
{
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
getSubTypeIndex
(),
rSlidePersist
.
getMasterPersist
()
->
getShapes
()
->
getChildren
()
);
if
(
mnSubType
&&
getSubTypeIndex
()
.
has
()
&&
rSlidePersist
.
getMasterPersist
().
get
()
)
{
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
getSubTypeIndex
()
.
get
()
,
rSlidePersist
.
getMasterPersist
()
->
getShapes
()
->
getChildren
()
);
if
(
pPlaceholder
.
get
())
{
OSL_TRACE
(
"found placeholder with index: %d and type: %s"
,
getSubTypeIndex
(),
lclDebugSubType
(
mnSubType
));
OSL_TRACE
(
"found placeholder with index: %d and type: %s"
,
getSubTypeIndex
()
.
get
()
,
lclDebugSubType
(
mnSubType
));
}
if
(
pPlaceholder
.
get
()
)
{
PPTShape
*
pPPTPlaceholder
=
dynamic_cast
<
PPTShape
*
>
(
pPlaceholder
.
get
()
);
...
...
@@ -290,7 +290,7 @@ void PPTShape::addShape(
OSL_TRACE
(
"placeholder has parent placeholder: %s type: %s index: %d"
,
rtl
::
OUStringToOString
(
pPPTPlaceholder
->
mpPlaceholder
->
getId
(),
RTL_TEXTENCODING_UTF8
).
getStr
(),
lclDebugSubType
(
pPPTPlaceholder
->
mpPlaceholder
->
getSubType
()
),
pPPTPlaceholder
->
mpPlaceholder
->
getSubTypeIndex
()
);
pPPTPlaceholder
->
mpPlaceholder
->
getSubTypeIndex
()
.
get
()
);
OSL_TRACE
(
"has textbody %d"
,
pPPTPlaceholder
->
mpPlaceholder
->
getTextBody
()
!=
NULL
);
TextListStylePtr
pPlaceholderStyle
=
getSubTypeTextListStyle
(
rSlidePersist
,
pPPTPlaceholder
->
mpPlaceholder
->
getSubType
()
);
if
(
pPPTPlaceholder
->
mpPlaceholder
->
getTextBody
()
)
...
...
@@ -403,13 +403,10 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholderByIndex( const sal_Int32 nIdx,
{
oox
::
drawingml
::
ShapePtr
aShapePtr
;
if
(
nIdx
==
-
1
)
return
aShapePtr
;
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>::
reverse_iterator
aRevIter
(
rShapes
.
rbegin
()
);
while
(
aRevIter
!=
rShapes
.
rend
()
)
{
if
(
(
*
aRevIter
)
->
getSubTypeIndex
()
==
nIdx
)
if
(
(
*
aRevIter
)
->
getSubTypeIndex
()
.
has
()
&&
(
*
aRevIter
)
->
getSubTypeIndex
().
get
()
==
nIdx
)
{
aShapePtr
=
*
aRevIter
;
break
;
...
...
oox/source/ppt/pptshapecontext.cxx
Dosyayı görüntüle @
eb5f2df4
...
...
@@ -62,35 +62,40 @@ PPTShapeContext::PPTShapeContext( ContextHandler& rParent, const SlidePersistPtr
{
}
oox
::
drawingml
::
ShapePtr
findPlaceholder
(
const
sal_Int32
nMasterPlaceholder
,
sal_Int32
n
SubTypeIndex
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
oox
::
drawingml
::
ShapePtr
findPlaceholder
(
const
sal_Int32
nMasterPlaceholder
,
const
OptValue
<
sal_Int32
>&
o
SubTypeIndex
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
{
oox
::
drawingml
::
ShapePtr
aShapePtr
;
oox
::
drawingml
::
ShapePtr
aTmpShapePtr
;
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>::
reverse_iterator
aRevIter
(
rShapes
.
rbegin
()
);
while
(
aRevIter
!=
rShapes
.
rend
()
)
{
if
(
(
*
aRevIter
)
->
getSubType
()
==
nMasterPlaceholder
)
{
if
(
(
nSubTypeIndex
==
-
1
)
||
(
nSubTypeIndex
==
(
*
aRevIter
)
->
getSubTypeIndex
()
)
)
if
(
!
oSubTypeIndex
.
has
()
&&
aTmpShapePtr
==
NULL
)
aTmpShapePtr
=
*
aRevIter
;
if
(
(
*
aRevIter
)
->
getSubTypeIndex
()
==
oSubTypeIndex
)
{
aShapePtr
=
*
aRevIter
;
break
;
}
}
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rChildren
=
(
*
aRevIter
)
->
getChildren
();
aShapePtr
=
findPlaceholder
(
nMasterPlaceholder
,
n
SubTypeIndex
,
rChildren
);
aShapePtr
=
findPlaceholder
(
nMasterPlaceholder
,
o
SubTypeIndex
,
rChildren
);
if
(
aShapePtr
.
get
()
)
break
;
++
aRevIter
;
}
if
(
aShapePtr
==
NULL
)
return
aTmpShapePtr
;
return
aShapePtr
;
}
// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
oox
::
drawingml
::
ShapePtr
findPlaceholder
(
sal_Int32
nFirstPlaceholder
,
sal_Int32
nSecondPlaceholder
,
sal_Int32
n
SubTypeIndex
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
const
OptValue
<
sal_Int32
>&
o
SubTypeIndex
,
std
::
vector
<
oox
::
drawingml
::
ShapePtr
>&
rShapes
)
{
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
findPlaceholder
(
nFirstPlaceholder
,
n
SubTypeIndex
,
rShapes
);
return
!
nSecondPlaceholder
||
pPlaceholder
.
get
()
?
pPlaceholder
:
findPlaceholder
(
nSecondPlaceholder
,
n
SubTypeIndex
,
rShapes
);
oox
::
drawingml
::
ShapePtr
pPlaceholder
=
findPlaceholder
(
nFirstPlaceholder
,
o
SubTypeIndex
,
rShapes
);
return
!
nSecondPlaceholder
||
pPlaceholder
.
get
()
?
pPlaceholder
:
findPlaceholder
(
nSecondPlaceholder
,
o
SubTypeIndex
,
rShapes
);
}
Reference
<
XFastContextHandler
>
PPTShapeContext
::
createFastChildContext
(
sal_Int32
aElementToken
,
const
Reference
<
XFastAttributeList
>&
xAttribs
)
throw
(
SAXException
,
RuntimeException
)
...
...
@@ -168,7 +173,8 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
oox
::
drawingml
::
ShapePtr
pPlaceholder
;
if
(
eShapeLocation
==
Layout
)
// for layout objects the referenced object can be found within the same shape tree
{
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
pPPTShapePtr
->
getSubTypeIndex
(),
mpSlidePersistPtr
->
getShapes
()
->
getChildren
()
);
if
(
pPPTShapePtr
->
getSubTypeIndex
().
has
()
)
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
pPPTShapePtr
->
getSubTypeIndex
().
get
(),
mpSlidePersistPtr
->
getShapes
()
->
getChildren
()
);
if
(
!
pPlaceholder
.
get
()
)
pPlaceholder
=
findPlaceholder
(
nFirstPlaceholder
,
nSecondPlaceholder
,
pPPTShapePtr
->
getSubTypeIndex
(),
mpSlidePersistPtr
->
getShapes
()
->
getChildren
()
);
...
...
@@ -177,7 +183,8 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
{
SlidePersistPtr
pMasterPersist
(
mpSlidePersistPtr
->
getMasterPersist
()
);
if
(
pMasterPersist
.
get
()
)
{
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
pPPTShapePtr
->
getSubTypeIndex
(),
pMasterPersist
->
getShapes
()
->
getChildren
()
);
if
(
pPPTShapePtr
->
getSubTypeIndex
().
has
()
)
pPlaceholder
=
PPTShape
::
findPlaceholderByIndex
(
pPPTShapePtr
->
getSubTypeIndex
().
get
(),
pMasterPersist
->
getShapes
()
->
getChildren
()
);
if
(
!
pPlaceholder
.
get
()
)
pPlaceholder
=
findPlaceholder
(
nFirstPlaceholder
,
nSecondPlaceholder
,
pPPTShapePtr
->
getSubTypeIndex
(),
pMasterPersist
->
getShapes
()
->
getChildren
()
);
...
...
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