diff options
author | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
commit | ef15a5a4acd3174752484c6aeb570d4d6444b645 (patch) | |
tree | 3d1d5b58f85737aa46241aea4c4dabea520cecc2 /xmloff | |
parent | a1b0ce05e851e9724c046888a01869eddf9e9db2 (diff) | |
parent | c309ce0227a14330094191c1ef15fa00899defcb (diff) |
Merge remote-tracking branch 'origin/libreoffice-3-6-3' into suse-3.6
Conflicts:
desktop/source/app/sofficemain.cxx
instsetoo_native/util/openoffice.lst
solenv/inc/minor.mk
Change-Id: I3e9510067c7173f6c71368e70ba6dfe168c5318e
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/txtparae.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport2.cxx | 18 | ||||
-rw-r--r-- | xmloff/source/style/chrhghdl.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 69 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 1 |
6 files changed, 77 insertions, 17 deletions
diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index c5d3e75ce4f2..284e88fa550f 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -44,6 +44,7 @@ #include <xmloff/SinglePropertySetInfoCache.hxx> #include <xmloff/XMLStringVector.hxx> #include <vector> +#include <boost/scoped_ptr.hpp> class XMLTextListsHelper; class SvXMLExport; @@ -76,6 +77,8 @@ namespace xmloff class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport { + struct Impl; + ::boost::scoped_ptr<Impl> m_pImpl; // SvXMLExport& rExport; SvXMLAutoStylePoolP& rAutoStylePool; diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 00856c83572a..56a5e6783f21 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -1452,6 +1452,24 @@ void XMLShapeExport::ImpExportConnectorShape( } } + // get matrix + ::basegfx::B2DHomMatrix aMatrix; + ImpExportNewTrans_GetB2DHomMatrix(aMatrix, xProps); + + // decompose and correct about pRefPoint + ::basegfx::B2DTuple aTRScale; + double fTRShear(0.0); + double fTRRotate(0.0); + ::basegfx::B2DTuple aTRTranslate; + ImpExportNewTrans_DecomposeAndRefPoint(aMatrix, aTRScale, fTRShear, + fTRRotate, aTRTranslate, pRefPoint); + + // fdo#49678: create and export ViewBox + awt::Point aPoint(0, 0); + awt::Size aSize(FRound(aTRScale.getX()), FRound(aTRScale.getY())); + SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height); + mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString()); + // write connector shape. Add Export later. sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_CONNECTOR, bCreateNewline, sal_True); diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 8b8f842ec7f7..0a607efd1bd9 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -67,6 +67,7 @@ sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if (::sax::Converter::convertDouble(fSize, rStrImpValue, eSrcUnit, util::MeasureUnit::POINT)) { + fSize = ::std::max<double>(fSize, 1.0); // fdo#49876: 0pt is invalid rValue <<= (float)fSize; return sal_True; } @@ -82,6 +83,7 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV float fSize = 0; if( rValue >>= fSize ) { + fSize = ::std::max<float>(fSize, 1.0f); // fdo#49876: 0pt is invalid ::sax::Converter::convertDouble(aOut, (double)fSize, true, util::MeasureUnit::POINT, util::MeasureUnit::POINT); aOut.append( sal_Unicode('p')); diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 410bb05d6938..7b17574845e8 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1696,6 +1696,7 @@ void XMLTextFieldExport::ExportFieldHelper( ProcessString(XML_TARGET_FRAME_NAME, GetStringProperty(sPropertyTargetFrame,rPropSet), sal_True, XML_NAMESPACE_OFFICE); + GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); SvXMLElementExport aUrlField(rExport, XML_NAMESPACE_TEXT, XML_A, sal_False, sal_False); GetExport().Characters(sPresentation); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 04b008cd993b..01ad5dc8e164 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1153,11 +1153,36 @@ void XMLTextParagraphExport::exportListChange( } } +struct XMLTextParagraphExport::Impl +{ + typedef ::std::map<Reference<XFormField>, sal_Int32> FieldMarkMap_t; + FieldMarkMap_t m_FieldMarkMap; + + explicit Impl() {} + sal_Int32 AddFieldMarkStart(Reference<XFormField> const& i_xFieldMark) + { + assert(m_FieldMarkMap.find(i_xFieldMark) == m_FieldMarkMap.end()); + sal_Int32 const ret(m_FieldMarkMap.size()); + m_FieldMarkMap.insert(::std::make_pair(i_xFieldMark, ret)); + return ret; + } + sal_Int32 GetFieldMarkIndex(Reference<XFormField> const& i_xFieldMark) + { + FieldMarkMap_t::const_iterator const it( + m_FieldMarkMap.find(i_xFieldMark)); + // rely on SwXFieldmark::CreateXFieldmark returning the same instance + // because the Reference in m_FieldMarkMap will keep it alive + assert(it != m_FieldMarkMap.end()); + return it->second; + } +}; + XMLTextParagraphExport::XMLTextParagraphExport( SvXMLExport& rExp, SvXMLAutoStylePoolP & rASP ) : XMLStyleExport( rExp, OUString(), &rASP ), + m_pImpl(new Impl), rAutoStylePool( rASP ), pBoundFrameSets(new BoundFrameSets(GetExport().GetModel())), pFieldExport( 0 ), @@ -2179,7 +2204,8 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bPrvChrIsSpc ) { - static OUString sMeta("InContentMetadata"); + static const OUString sMeta("InContentMetadata"); + static const OUString sFieldMarkName("__FieldMark_"); bool bPrevCharIsSpace = bPrvChrIsSpc; /* This is used for exporting to strict OpenDocument 1.2, in which case traditional @@ -2291,16 +2317,22 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xFormField.is()) { + OUString sName; Reference< ::com::sun::star::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY); if (xParameters.is() && xParameters->hasByName("Name")) { const Any aValue = xParameters->getByName("Name"); OUString sValue; - if (aValue >>= sValue) - { - GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sValue); - } + aValue >>= sName; + } + if (sName.isEmpty()) + { // name attribute is mandatory, so have to pull a + // rabbit out of the hat here + sName = sFieldMarkName + OUString::valueOf( + m_pImpl->AddFieldMarkStart(xFormField)); } + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, + sName); SvXMLElementExport aElem( GetExport(), !bAutoStyles, XML_NAMESPACE_TEXT, XML_BOOKMARK_START, sal_False, sal_False ); @@ -2333,20 +2365,25 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xFormField.is()) { + OUString sName; Reference< ::com::sun::star::container::XNameAccess > xParameters(xFormField->getParameters(), UNO_QUERY); if (xParameters.is() && xParameters->hasByName("Name")) { const Any aValue = xParameters->getByName("Name"); - OUString sValue; - if (aValue >>= sValue) - { - GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, sValue); - } + aValue >>= sName; } + if (sName.isEmpty()) + { // name attribute is mandatory, so have to pull a + // rabbit out of the hat here + sName = sFieldMarkName + OUString::valueOf( + m_pImpl->GetFieldMarkIndex(xFormField)); + } + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, + sName); + SvXMLElementExport aElem( GetExport(), !bAutoStyles, + XML_NAMESPACE_TEXT, XML_BOOKMARK_END, + sal_False, sal_False ); } - SvXMLElementExport aElem( GetExport(), !bAutoStyles, - XML_NAMESPACE_TEXT, XML_BOOKMARK_END, - sal_False, sal_False ); } } else if (sType.equals(sTextFieldStartEnd)) @@ -2376,10 +2413,10 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( if (xBookmark.is()) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName()); + SvXMLElementExport aElem( GetExport(), !bAutoStyles, + XML_NAMESPACE_TEXT, XML_BOOKMARK, + sal_False, sal_False ); } - SvXMLElementExport aElem( GetExport(), !bAutoStyles, - XML_NAMESPACE_TEXT, XML_BOOKMARK, - sal_False, sal_False ); } } else if (sType.equals(sSoftPageBreak)) diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index edf8c2d1f79d..b2edddc28243 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -276,7 +276,6 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MP_E( "ParaRegisterModeActive", STYLE, REGISTER_TRUE, XML_TYPE_BOOL, 0 ), // RES_PARATR_NUMRULE MP_E( "NumberingStyleName", STYLE, LIST_STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STYLENAME, CTF_NUMBERINGSTYLENAME ), - MP_E( "NumberingRules", TEXT, ENABLE_NUMBERING, MID_FLAG_NO_PROPERTY|XML_TYPE_BOOL, CTF_ALIEN_ATTRIBUTE_IMPORT ), // RES_FILL_ORDER // not required |