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
3554f377
Kaydet (Commit)
3554f377
authored
Şub 21, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ooxml: export w14:glow with subelements from a CharGrabGab
Change-Id: I3e60f0532a18eba12f7a63c3e745668f54b8806e
üst
02d8db73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
1 deletion
+106
-1
docxattributeoutput.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
+102
-1
docxattributeoutput.hxx
sw/source/filter/ww8/docxattributeoutput.hxx
+3
-0
docxexport.cxx
sw/source/filter/ww8/docxexport.cxx
+1
-0
No files found.
sw/source/filter/ww8/docxattributeoutput.cxx
Dosyayı görüntüle @
3554f377
...
...
@@ -1121,7 +1121,8 @@ void DocxAttributeOutput::InitCollectedRunProperties()
FSNS( XML_w, XML_eastAsianLayout ),
FSNS( XML_w, XML_specVanish ),
FSNS( XML_w, XML_oMath ),
FSNS( XML_w, XML_rPrChange )
FSNS( XML_w, XML_rPrChange ),
FSNS( XML_w14, XML_glow ),
};
// postpone the output so that we can later [in EndParagraphProperties()]
...
...
@@ -1135,6 +1136,94 @@ void DocxAttributeOutput::InitCollectedRunProperties()
}
namespace
{
struct NameToId
{
const OUString maName;
const sal_Int32 maId;
};
const NameToId aNameToIdMapping[] =
{
{ OUString("val"), FSNS( XML_w14, XML_val ) },
{ OUString("rad"), FSNS( XML_w14, XML_rad ) },
{ OUString("schemeClr"), FSNS( XML_w14, XML_schemeClr ) },
{ OUString("srgbClr"), FSNS( XML_w14, XML_srgbClr ) },
{ OUString("tint"), FSNS( XML_w14, XML_tint ) },
{ OUString("shade"), FSNS( XML_w14, XML_shade ) },
{ OUString("alpha"), FSNS( XML_w14, XML_alpha ) },
{ OUString("hueMod"), FSNS( XML_w14, XML_hueMod ) },
{ OUString("sat"), FSNS( XML_w14, XML_sat ) },
{ OUString("satOff"), FSNS( XML_w14, XML_satOff ) },
{ OUString("satMod"), FSNS( XML_w14, XML_satMod ) },
{ OUString("lum"), FSNS( XML_w14, XML_lum ) },
{ OUString("lumOff"), FSNS( XML_w14, XML_lumOff ) },
{ OUString("lumMod"), FSNS( XML_w14, XML_lumMod ) },
};
void lclProcessRecursiveGrabBag(sal_Int32 aElementId, css::uno::Sequence<css::beans::PropertyValue> aElements, sax_fastparser::FSHelperPtr pSerializer)
{
css::uno::Sequence<css::beans::PropertyValue> aAttributes;
FastAttributeList* pAttributes = pSerializer->createAttrList();
for (sal_Int32 j=0; j < aElements.getLength(); ++j)
{
if( aElements[j].Name == "attributes")
{
aElements[j].Value >>= aAttributes;
}
}
for (sal_Int32 j=0; j < aAttributes.getLength(); ++j)
{
uno::Any aAny = aAttributes[j].Value;
OString aValue;
if(aAny.getValueType() == getCppuType<sal_Int32>())
{
aValue = OString::number(aAny.get<sal_Int32>());
}
else if(aAny.getValueType() == getCppuType<OUString>())
{
aValue = OUStringToOString(aAny.get<OUString>(), RTL_TEXTENCODING_ASCII_US);
}
sal_Int32 aLength = sizeof (aNameToIdMapping) / sizeof(NameToId);
for (sal_Int32 i=0; i < aLength; ++i)
{
if(aAttributes[j].Name == aNameToIdMapping[i].maName)
{
pAttributes->add( aNameToIdMapping[i].maId, aValue.getStr());
}
}
}
XFastAttributeListRef xAttributesList( pAttributes );
pSerializer->startElement(aElementId, xAttributesList);
for (sal_Int32 j=0; j < aElements.getLength(); ++j)
{
css::uno::Sequence<css::beans::PropertyValue> aSumElements;
sal_Int32 aLength = sizeof (aNameToIdMapping) / sizeof(NameToId);
for (sal_Int32 i=0; i < aLength; ++i)
{
if( aElements[j].Name == aNameToIdMapping[i].maName)
{
aElements[j].Value >>= aSumElements;
lclProcessRecursiveGrabBag(aNameToIdMapping[i].maId, aSumElements, pSerializer);
}
}
}
pSerializer->endElement(aElementId);
}
}
void DocxAttributeOutput::WriteCollectedRunProperties()
{
// Write all differed properties
...
...
@@ -1169,6 +1258,12 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
m_pSerializer->singleElementNS( XML_w, XML_lang, xAttrList );
}
if (m_aTextEffectsGrabBag.getLength() > 0)
{
lclProcessRecursiveGrabBag(FSNS( XML_w14, XML_glow ), m_aTextEffectsGrabBag, m_pSerializer);
m_aTextEffectsGrabBag.realloc(0);
}
}
void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData )
...
...
@@ -6342,6 +6437,12 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
{
// just skip these, they were processed before
}
else if (i->first == "CharGlowTextEffect")
{
uno::Sequence<beans::PropertyValue> aGrabBagSeq;
i->second >>= aGrabBagSeq;
m_aTextEffectsGrabBag = aGrabBagSeq;
}
else
SAL_INFO("sw.ww8", "DocxAttributeOutput::CharGrabBag: unhandled grab bag property " << i->first);
}
...
...
sw/source/filter/ww8/docxattributeoutput.hxx
Dosyayı görüntüle @
3554f377
...
...
@@ -736,6 +736,9 @@ private:
/// names of these bookmarks for each sequence.
std
::
map
<
OUString
,
std
::
vector
<
OString
>
>
m_aSeqBookmarksNames
;
/// GrabBag for text effexts like glow
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
m_aTextEffectsGrabBag
;
/// The current table helper
SwWriteTable
*
m_pTableWrt
;
...
...
sw/source/filter/ww8/docxexport.cxx
Dosyayı görüntüle @
3554f377
...
...
@@ -1255,6 +1255,7 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces( FSHelperPtr serializer )
pAttr
->
add
(
FSNS
(
XML_xmlns
,
XML_wpg
),
"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
);
pAttr
->
add
(
FSNS
(
XML_xmlns
,
XML_mc
),
"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
pAttr
->
add
(
FSNS
(
XML_xmlns
,
XML_wp14
),
"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
);
pAttr
->
add
(
FSNS
(
XML_xmlns
,
XML_w14
),
"http://schemas.microsoft.com/office/word/2010/wordml"
);
return
XFastAttributeListRef
(
pAttr
);
}
...
...
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