summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-02-03 17:27:36 +0800
committerMark Hung <marklh9@gmail.com>2018-02-10 10:16:31 +0100
commit275a60e17ddfacae505df56374b334261a646a3b (patch)
treef4a1ad6a59dfdccc24a1ac50fe1f6dd9f67ca8e6 /writerfilter/source
parent94ab8e4360a2a7a932656e99f718244321d0f923 (diff)
writerfilter / ww8filter: enhancement to support new ruby position.
1. Allow ooxml / rtf import the ruby aligned on the right side ( rightVertical or jc=5 ) as css::text::RubyPosition::INTER_CHARACTER. 2. Allow rtf / ww8 export of css::text::RubyPosition::INTER_CHARACTER as jc=5. Though rtf filter can save and load the new ruby position, character format seems lost. The reset of the MSO formats have other issues that they can't make roundtrip yet. Change-Id: Idb77423842f43abc375a1282a52b0bc6f20049e4 Reviewed-on: https://gerrit.libreoffice.org/49177 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx3
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
4 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 068c08554559..080bfdc6fb14 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XFootnote.hpp>
#include <com/sun/star/text/XTextColumns.hpp>
+#include <com/sun/star/text/RubyPosition.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/text/FontEmphasis.hpp>
#include <com/sun/star/awt/CharSet.hpp>
@@ -2708,6 +2709,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
rContext->Insert(PROP_RUBY_TEXT, uno::makeAny(aInfo.sRubyText));
rContext->Insert(PROP_RUBY_STYLE, uno::makeAny(aInfo.sRubyStyle));
rContext->Insert(PROP_RUBY_ADJUST, uno::makeAny(static_cast<sal_Int16>(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign))));
+ if ( aInfo.nRubyAlign == NS_ooxml::LN_Value_ST_RubyAlign_rightVertical )
+ rContext->Insert(PROP_RUBY_POSITION, uno::makeAny(css::text::RubyPosition::INTER_CHARACTER));
+
m_pImpl->SetRubySprmId(0);
}
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 142171247a89..9060b3ce0dbd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/text/XParagraphCursor.hpp>
#include <com/sun/star/text/XRedline.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/text/RubyPosition.hpp>
#include <com/sun/star/style/DropCapFormat.hpp>
#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -3261,6 +3262,8 @@ void DomainMapper_Impl::handleRubyEQField( const FieldContextPtr& pContext)
pCharContext->InsertProps(pContext->getProperties());
pCharContext->Insert(PROP_RUBY_TEXT, uno::makeAny( aInfo.sRubyText ) );
pCharContext->Insert(PROP_RUBY_ADJUST, uno::makeAny(static_cast<sal_Int16>(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign))));
+ if ( aInfo.nRubyAlign == NS_ooxml::LN_Value_ST_RubyAlign_rightVertical )
+ pCharContext->Insert(PROP_RUBY_POSITION, uno::makeAny(css::text::RubyPosition::INTER_CHARACTER));
pCharContext->Insert(PROP_RUBY_STYLE, uno::makeAny(aInfo.sRubyStyle));
appendTextPortion(sPart2, pCharContext);
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index e109ca15d0c6..6035b617a465 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -353,6 +353,7 @@ OUString getPropertyName( PropertyIds eId )
case PROP_RUBY_STYLE: sName = "RubyCharStyleName"; break;
case PROP_RUBY_TEXT: sName = "RubyText"; break;
case PROP_RUBY_ADJUST: sName = "RubyAdjust"; break;
+ case PROP_RUBY_POSITION: sName = "RubyPosition"; break;
}
assert(sName.getLength()>0);
return sName;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 911667e9dd09..f69b6531b7db 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -351,6 +351,7 @@ enum PropertyIds
,PROP_RUBY_STYLE
,PROP_RUBY_TEXT
,PROP_RUBY_ADJUST
+ ,PROP_RUBY_POSITION
};
//Returns the UNO string equivalent to eId.