Kaydet (Commit) a6fe1a5b authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: handle NS_sprm::LN_CFSmallCaps == 0 after NS_sprm::LN_CFCaps

"caps and no smallcaps" means style::CaseMap::UPPERCASE, not
style::CaseMap::NONE. Different XML elements in DOCX, single UNO
property.

Change-Id: I8cbc719f2c307d5d2cbd4af93ea61e35b640ad1d
üst f336d8f8
......@@ -24,6 +24,7 @@
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/XTextSection.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
......@@ -1389,6 +1390,11 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx")
DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx")
{
// Problem was that CharCaseMap was style::CaseMap::NONE.
uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharCaseMap"));
// This paragraph property was missing in table style.
xmlDocPtr pXmlStyles = parseExport("word/styles.xml");
if (!pXmlStyles)
......
......@@ -2225,8 +2225,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
rContext->Insert(ePropertyId, uno::makeAny( nIntValue ? true : false ));
break;
case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
rContext->Insert(ePropertyId,
uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE));
// If smallcaps would be just disabled and an other casemap is already inserted, don't do anything.
if (nIntValue || rContext->find(ePropertyId) == rContext->end())
rContext->Insert(ePropertyId, uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE));
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "smallCaps", OUString::number(nIntValue));
break;
case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment