summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf127741.docxbin0 -> 19275 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx10
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx24
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx3
4 files changed, 22 insertions, 15 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf127741.docx b/sw/qa/extras/ooxmlexport/data/tdf127741.docx
new file mode 100644
index 000000000000..1bedb9ade516
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf127741.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 89028e3e7e24..59556249cfb5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -834,6 +834,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123628, "tdf123628.odt")
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='InternetLink']/w:name", "val", "Hyperlink");
}
+DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx")
+{
+ uno::Reference<text::XTextRange> xPara = getParagraph(1);
+ uno::Reference<beans::XPropertySet> xRun(getRun(xPara,1), uno::UNO_QUERY);
+ OUString unVisitedStyleName = getProperty<OUString>(xRun, "UnvisitedCharStyleName");
+ CPPUNIT_ASSERT(unVisitedStyleName.equalsIgnoreAsciiCase("Internet Link"));
+ OUString visitedStyleName = getProperty<OUString>(xRun, "VisitedCharStyleName");
+ CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f69b53fbf2fe..c2d087fe4d59 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1784,15 +1784,6 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, const Proper
}
else
{
- if (IsOpenField() && GetTopFieldContext()->GetFieldId() == FIELD_HYPERLINK)
- {
- // It is content of hyperlink field. We need to create and remember
- // character style for later applying to hyperlink
- PropertyValueVector_t aProps = comphelper::sequenceToContainer< PropertyValueVector_t >(GetTopContext()->GetPropertyValues());
- OUString sHyperlinkStyleName = GetStyleSheetTable()->getOrCreateCharStyle(aProps, /*bAlwaysCreate=*/false);
- GetTopFieldContext()->SetHyperlinkStyle(sHyperlinkStyleName);
- }
-
#if !defined(MACOSX) // TODO: check layout differences and support all platforms, if needed
sal_Int32 nPos;
OUString sDoubleSpace(" ");
@@ -5385,10 +5376,19 @@ void DomainMapper_Impl::PopFieldContext()
}
else
{
- if (!pContext->GetHyperlinkStyle().isEmpty())
+ uno::Any aAny = xCrsrProperties->getPropertyValue("CharStyleName");
+ OUString charStyle;
+ if (css::uno::fromAny(aAny, &charStyle))
{
- xCrsrProperties->setPropertyValue("VisitedCharStyleName", uno::makeAny(pContext->GetHyperlinkStyle()));
- xCrsrProperties->setPropertyValue("UnvisitedCharStyleName", uno::makeAny(pContext->GetHyperlinkStyle()));
+ if(!charStyle.isEmpty() && charStyle.equalsIgnoreAsciiCase("Internet Link"))
+ {
+ xCrsrProperties->setPropertyValue("CharStyleName", uno::makeAny(OUString("Default Style")));
+ }
+ else
+ {
+ xCrsrProperties->setPropertyValue("VisitedCharStyleName", aAny);
+ xCrsrProperties->setPropertyValue("UnvisitedCharStyleName", aAny);
+ }
}
}
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index fb4fcaf03349..6f5aaedd1fed 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -149,7 +149,6 @@ class FieldContext : public virtual SvRefBase
OUString m_sHyperlinkURL;
/// A frame for the hyperlink when one exists.
OUString m_sHyperlinkTarget;
- OUString m_sHyperlinkStyle;
FFDataHandler::Pointer_t m_pFFDataHandler;
FormControlHelper::Pointer_t m_pFormControlHelper;
@@ -194,8 +193,6 @@ public:
const OUString& GetHyperlinkURL() const { return m_sHyperlinkURL; }
void SetHyperlinkTarget(const OUString& rTarget) { m_sHyperlinkTarget = rTarget; }
const OUString& GetHyperlinkTarget() const { return m_sHyperlinkTarget; }
- void SetHyperlinkStyle(const OUString& rStyle) { m_sHyperlinkStyle = rStyle; }
- const OUString& GetHyperlinkStyle() const { return m_sHyperlinkStyle; }
void setFFDataHandler(FFDataHandler::Pointer_t pFFDataHandler) { m_pFFDataHandler = pFFDataHandler; }
const FFDataHandler::Pointer_t& getFFDataHandler() const { return m_pFFDataHandler; }