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
b862a216
Kaydet (Commit)
b862a216
authored
May 16, 2014
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ODF filters: fallback glTF model to bitmap for older versions
Change-Id: I33161401a29f511e61429355dd2905d4643fe8ff
üst
e627929e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
11 deletions
+70
-11
solar.hrc
include/svl/solar.hrc
+1
-1
unoshprp.hxx
include/svx/unoshprp.hxx
+2
-1
unoprov.cxx
svx/source/unodraw/unoprov.cxx
+1
-0
unoshap4.cxx
svx/source/unodraw/unoshap4.cxx
+6
-1
shapeexport.cxx
xmloff/source/draw/shapeexport.cxx
+47
-8
ximpshap.cxx
xmloff/source/draw/ximpshap.cxx
+13
-0
No files found.
include/svl/solar.hrc
Dosyayı görüntüle @
b862a216
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
// defines ------------------------------------------------------------------
// defines ------------------------------------------------------------------
#define OWN_ATTR_VALUE_START 3900
#define OWN_ATTR_VALUE_START 3900
#define OWN_ATTR_VALUE_END 399
2
#define OWN_ATTR_VALUE_END 399
3
#define RID_SFX_START 260
#define RID_SFX_START 260
// RID_SFX_END 9999
// RID_SFX_END 9999
...
...
include/svx/unoshprp.hxx
Dosyayı görüntüle @
b862a216
...
@@ -180,7 +180,8 @@
...
@@ -180,7 +180,8 @@
#define OWN_ATTR_MEDIA_TEMPFILEURL (OWN_ATTR_VALUE_START+90)
#define OWN_ATTR_MEDIA_TEMPFILEURL (OWN_ATTR_VALUE_START+90)
#define OWN_ATTR_INTEROPGRABBAG (OWN_ATTR_VALUE_START+91)
#define OWN_ATTR_INTEROPGRABBAG (OWN_ATTR_VALUE_START+91)
#define OWN_ATTR_MEDIA_MIMETYPE (OWN_ATTR_VALUE_START+92)
#define OWN_ATTR_MEDIA_MIMETYPE (OWN_ATTR_VALUE_START+92)
// ATTENTION: maximum is OWN_ATTR_VALUE_START+92, see include/svl/solar.hrc
#define OWN_ATTR_FALLBACK_GRAPHIC (OWN_ATTR_VALUE_START+93)
// ATTENTION: maximum is OWN_ATTR_VALUE_START+93 svx, see include/svl/solar.hrc
// #FontWork#
// #FontWork#
#define FONTWORK_PROPERTIES \
#define FONTWORK_PROPERTIES \
...
...
svx/source/unodraw/unoprov.cxx
Dosyayı görüntüle @
b862a216
...
@@ -733,6 +733,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxMediaShapePropertyMap()
...
@@ -733,6 +733,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxMediaShapePropertyMap()
{
OUString
(
"PrivateStream"
),
OWN_ATTR_MEDIA_STREAM
,
cppu
::
UnoType
<
css
::
io
::
XInputStream
>::
get
(),
::
com
::
sun
::
star
::
beans
::
PropertyAttribute
::
READONLY
,
0
},
{
OUString
(
"PrivateStream"
),
OWN_ATTR_MEDIA_STREAM
,
cppu
::
UnoType
<
css
::
io
::
XInputStream
>::
get
(),
::
com
::
sun
::
star
::
beans
::
PropertyAttribute
::
READONLY
,
0
},
{
OUString
(
"PrivateTempFileURL"
),
OWN_ATTR_MEDIA_TEMPFILEURL
,
::
cppu
::
UnoType
<
OUString
>::
get
(),
::
com
::
sun
::
star
::
beans
::
PropertyAttribute
::
READONLY
,
0
},
{
OUString
(
"PrivateTempFileURL"
),
OWN_ATTR_MEDIA_TEMPFILEURL
,
::
cppu
::
UnoType
<
OUString
>::
get
(),
::
com
::
sun
::
star
::
beans
::
PropertyAttribute
::
READONLY
,
0
},
{
OUString
(
"MediaMimeType"
),
OWN_ATTR_MEDIA_MIMETYPE
,
::
cppu
::
UnoType
<
OUString
>::
get
(),
0
,
0
},
{
OUString
(
"MediaMimeType"
),
OWN_ATTR_MEDIA_MIMETYPE
,
::
cppu
::
UnoType
<
OUString
>::
get
(),
0
,
0
},
{
OUString
(
"FallbackGraphic"
),
OWN_ATTR_FALLBACK_GRAPHIC
,
cppu
::
UnoType
<
css
::
graphic
::
XGraphic
>::
get
(),
::
com
::
sun
::
star
::
beans
::
PropertyAttribute
::
READONLY
,
0
},
{
OUString
(),
0
,
css
::
uno
::
Type
(),
0
,
0
}
{
OUString
(),
0
,
css
::
uno
::
Type
(),
0
,
0
}
};
};
...
...
svx/source/unodraw/unoshap4.cxx
Dosyayı görüntüle @
b862a216
...
@@ -911,7 +911,8 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr
...
@@ -911,7 +911,8 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr
(
pProperty
->
nWID
<=
OWN_ATTR_MEDIA_ZOOM
))
(
pProperty
->
nWID
<=
OWN_ATTR_MEDIA_ZOOM
))
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_STREAM
)
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_STREAM
)
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_TEMPFILEURL
)
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_TEMPFILEURL
)
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_MIMETYPE
))
||
(
pProperty
->
nWID
==
OWN_ATTR_MEDIA_MIMETYPE
)
||
(
pProperty
->
nWID
==
OWN_ATTR_FALLBACK_GRAPHIC
))
{
{
SdrMediaObj
*
pMedia
=
static_cast
<
SdrMediaObj
*
>
(
mpObj
.
get
()
);
SdrMediaObj
*
pMedia
=
static_cast
<
SdrMediaObj
*
>
(
mpObj
.
get
()
);
const
::
avmedia
::
MediaItem
aItem
(
pMedia
->
getMediaProperties
()
);
const
::
avmedia
::
MediaItem
aItem
(
pMedia
->
getMediaProperties
()
);
...
@@ -950,6 +951,10 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr
...
@@ -950,6 +951,10 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr
rValue
<<=
aItem
.
getMimeType
();
rValue
<<=
aItem
.
getMimeType
();
break
;
break
;
case
OWN_ATTR_FALLBACK_GRAPHIC
:
rValue
<<=
pMedia
->
getSnapshot
();
break
;
default
:
default
:
OSL_FAIL
(
"SvxMediaShape::getPropertyValueImpl(), unknown property!"
);
OSL_FAIL
(
"SvxMediaShape::getPropertyValueImpl(), unknown property!"
);
}
}
...
...
xmloff/source/draw/shapeexport.cxx
Dosyayı görüntüle @
b862a216
...
@@ -3154,8 +3154,10 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
...
@@ -3154,8 +3154,10 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
}
}
}
}
static
void
lcl_StoreJsonExternals
(
static
void
lcl_StoreJsonExternalsAndFallback
(
SvXMLExport
&
rExport
,
const
OUString
&
rURL
)
SvXMLExport
&
rExport
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
const
OUString
&
rURL
)
{
{
OUString
sUrlPath
;
OUString
sUrlPath
;
if
(
rURL
.
startsWithIgnoreAsciiCase
(
"vnd.sun.star.Package:"
,
&
sUrlPath
))
if
(
rURL
.
startsWithIgnoreAsciiCase
(
"vnd.sun.star.Package:"
,
&
sUrlPath
))
...
@@ -3184,20 +3186,57 @@ static void lcl_StoreJsonExternals(
...
@@ -3184,20 +3186,57 @@ static void lcl_StoreJsonExternals(
xTarget
->
openStorageElement
(
sUrlPath
.
copy
(
0
,
sUrlPath
.
lastIndexOf
(
"/"
)),
embed
::
ElementModes
::
WRITE
));
xTarget
->
openStorageElement
(
sUrlPath
.
copy
(
0
,
sUrlPath
.
lastIndexOf
(
"/"
)),
embed
::
ElementModes
::
WRITE
));
// Target of current model
// Target of current model
const
OUString
sModelName
=
sUrlPath
.
copy
(
sUrlPath
.
lastIndexOf
(
"/"
)
+
1
);
const
uno
::
Reference
<
embed
::
XStorage
>
xModelTarget
(
const
uno
::
Reference
<
embed
::
XStorage
>
xModelTarget
(
xModelsTarget
->
openStorageElement
(
s
UrlPath
.
copy
(
sUrlPath
.
lastIndexOf
(
"/"
)
+
1
)
,
embed
::
ElementModes
::
WRITE
));
xModelsTarget
->
openStorageElement
(
s
ModelName
,
embed
::
ElementModes
::
WRITE
));
xModelStorage
->
copyToStorage
(
xModelTarget
);
xModelStorage
->
copyToStorage
(
xModelTarget
);
uno
::
Reference
<
embed
::
XTransactedObject
>
const
xTransaction
(
xModelsTarget
,
uno
::
UNO_QUERY
);
/* Save the fallback image under the 'Model/Fallback/' folder
if
(
xTransaction
.
is
())
Place fallback image before the plugin tag otherwise older LO versions will parse an empty
plugin shape instead of the image. In current version this image will be ingored during import.*/
uno
::
Reference
<
graphic
::
XGraphic
>
xGraphic
(
xPropSet
->
getPropertyValue
(
"FallbackGraphic"
),
uno
::
UNO_QUERY
);
if
(
xGraphic
.
is
()
)
{
{
xTransaction
->
commit
();
// Fallback storage
const
uno
::
Reference
<
embed
::
XStorage
>
xFallbackTarget
(
xModelsTarget
->
openStorageElement
(
OUString
(
"Fallback"
),
embed
::
ElementModes
::
WRITE
));
uno
::
Reference
<
io
::
XStream
>
xPictureStream
(
xFallbackTarget
->
openStreamElement
(
sModelName
+
".png"
,
embed
::
ElementModes
::
WRITE
),
uno
::
UNO_QUERY_THROW
);
uno
::
Reference
<
graphic
::
XGraphicProvider
>
xProvider
(
graphic
::
GraphicProvider
::
create
(
comphelper
::
getProcessComponentContext
())
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aArgs
(
2
);
aArgs
[
0
].
Name
=
"MimeType"
;
aArgs
[
0
].
Value
<<=
OUString
(
"image/png"
);
aArgs
[
1
].
Name
=
"OutputStream"
;
aArgs
[
1
].
Value
<<=
xPictureStream
->
getOutputStream
();
xProvider
->
storeGraphic
(
xGraphic
,
aArgs
);
const
uno
::
Reference
<
embed
::
XTransactedObject
>
xFallbackTransaction
(
xFallbackTarget
,
uno
::
UNO_QUERY
);
if
(
xFallbackTransaction
.
is
())
{
xFallbackTransaction
->
commit
();
}
const
OUString
sFallbackURL
(
sUrlPath
.
copy
(
0
,
sUrlPath
.
lastIndexOf
(
"/"
))
+
"/Fallback/"
+
sModelName
+
".png"
);
rExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_HREF
,
sFallbackURL
);
rExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_TYPE
,
XML_SIMPLE
);
rExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_SHOW
,
XML_EMBED
);
rExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_ACTUATE
,
XML_ONLOAD
);
SvXMLElementExport
aImage
(
rExport
,
XML_NAMESPACE_DRAW
,
XML_IMAGE
,
false
,
true
);
}
const
uno
::
Reference
<
embed
::
XTransactedObject
>
xModelsTransaction
(
xModelsTarget
,
uno
::
UNO_QUERY
);
if
(
xModelsTransaction
.
is
())
{
xModelsTransaction
->
commit
();
}
}
}
}
catch
(
uno
::
Exception
const
&
e
)
catch
(
uno
::
Exception
const
&
e
)
{
{
SAL_INFO
(
"xmloff"
,
"exception while s
tor
ing embedded model: '"
<<
e
.
Message
<<
"'"
);
SAL_INFO
(
"xmloff"
,
"exception while s
av
ing embedded model: '"
<<
e
.
Message
<<
"'"
);
}
}
}
}
}
}
...
@@ -3229,7 +3268,7 @@ void XMLShapeExport::ImpExportMediaShape(
...
@@ -3229,7 +3268,7 @@ void XMLShapeExport::ImpExportMediaShape(
OUString
const
persistentURL
=
OUString
const
persistentURL
=
lcl_StoreMediaAndGetURL
(
GetExport
(),
xPropSet
,
aMediaURL
,
sMimeType
);
lcl_StoreMediaAndGetURL
(
GetExport
(),
xPropSet
,
aMediaURL
,
sMimeType
);
if
(
sMimeType
==
"application/vnd.gltf+json"
)
if
(
sMimeType
==
"application/vnd.gltf+json"
)
lcl_StoreJsonExternals
(
GetExport
()
,
aMediaURL
);
lcl_StoreJsonExternals
AndFallback
(
GetExport
(),
xPropSet
,
aMediaURL
);
mrExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_HREF
,
persistentURL
);
mrExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_HREF
,
persistentURL
);
mrExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_TYPE
,
XML_SIMPLE
);
mrExport
.
AddAttribute
(
XML_NAMESPACE_XLINK
,
XML_TYPE
,
XML_SIMPLE
);
...
...
xmloff/source/draw/ximpshap.cxx
Dosyayı görüntüle @
b862a216
...
@@ -3056,6 +3056,7 @@ SdXMLPluginShapeContext::~SdXMLPluginShapeContext()
...
@@ -3056,6 +3056,7 @@ SdXMLPluginShapeContext::~SdXMLPluginShapeContext()
void
SdXMLPluginShapeContext
::
StartElement
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
)
void
SdXMLPluginShapeContext
::
StartElement
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
)
{
{
// watch for MimeType attribute to see if we have a media object
// watch for MimeType attribute to see if we have a media object
for
(
sal_Int16
n
=
0
,
nAttrCount
=
(
xAttrList
.
is
()
?
xAttrList
->
getLength
()
:
0
);
n
<
nAttrCount
;
++
n
)
for
(
sal_Int16
n
=
0
,
nAttrCount
=
(
xAttrList
.
is
()
?
xAttrList
->
getLength
()
:
0
);
n
<
nAttrCount
;
++
n
)
{
{
...
@@ -3583,6 +3584,18 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
...
@@ -3583,6 +3584,18 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
}
}
}
}
}
}
// For glTF models the fallback image is placed before the real shape.
// So we need to remove the fallback image after real shape is detected.
else
if
(
mxImplContext
.
Is
()
&&
IsXMLToken
(
mxImplContext
->
GetLocalName
(),
XML_IMAGE
)
&&
IsXMLToken
(
rLocalName
,
XML_PLUGIN
)
)
{
SvXMLShapeContext
*
pShapeContext
=
GetImport
().
GetShapeImport
()
->
CreateFrameChildContext
(
GetImport
(),
nPrefix
,
rLocalName
,
xAttrList
,
mxShapes
,
mxAttrList
);
pContext
=
pShapeContext
;
if
(
pContext
)
removeGraphicFromImportContext
(
*
mxImplContext
);
}
// call parent for content
// call parent for content
if
(
!
pContext
)
if
(
!
pContext
)
...
...
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