diff options
author | Eike Rathke <erack@redhat.com> | 2018-10-09 17:17:29 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-10-09 18:37:27 +0200 |
commit | 1b8886ad7744fc48e09bb7379d8ad8e75bb3084d (patch) | |
tree | 622184a8c2f797afbab8368cc3eb7e2ff76214e2 /editeng | |
parent | 828d91ecde50b3a5e6c02ef1e5061e6e655a1399 (diff) |
Resolves: tdf#66545 display URL fields non-shaded in Calc
This disables shading of URL and email address fields when
displaying cell content and still preserves shading in the Input
Line and when editing cell content to indicate that it is actually
a field content value.
Change-Id: I8737045168646b6cd446bd357713ec9ac4631b31
Reviewed-on: https://gerrit.libreoffice.org/61594
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editstt2.hxx | 7 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 15 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 7 |
3 files changed, 25 insertions, 4 deletions
diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 15a8a0ed239e..fe51f3b6168d 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -81,8 +81,11 @@ public: bool AutoPageHeight() const { return bool( nControlBits & EEControlBits::AUTOPAGESIZEY ); } - bool MarkFields() const - { return bool( nControlBits & EEControlBits::MARKFIELDS ); } + bool MarkNonUrlFields() const + { return bool( nControlBits & EEControlBits::MARKNONURLFIELDS ); } + + bool MarkUrlFields() const + { return bool( nControlBits & EEControlBits::MARKURLFIELDS ); } bool DoRestoreFont() const { return bool( nControlBits & EEControlBits::RESTOREFONT ); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index c15f0fde7cbf..025182a07bb8 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2973,8 +2973,21 @@ bool ImpEditEngine::UpdateFields() std::unique_ptr<EditCharAttribField> pCurrent(new EditCharAttribField(rField)); rField.Reset(); - if ( aStatus.MarkFields() ) + if (!aStatus.MarkNonUrlFields() && !aStatus.MarkUrlFields()) + ; // nothing marked + else if (aStatus.MarkNonUrlFields() && aStatus.MarkUrlFields()) rField.GetFieldColor() = GetColorConfig().GetColorValue( svtools::WRITERFIELDSHADINGS ).nColor; + else + { + bool bURL = false; + if (const SvxFieldItem* pFieldItem = dynamic_cast<const SvxFieldItem*>(rField.GetItem())) + { + if (const SvxFieldData* pFieldData = pFieldItem->GetField()) + bURL = (dynamic_cast<const SvxURLField* >(pFieldData) != nullptr); + } + if ((bURL && aStatus.MarkUrlFields()) || (!bURL && aStatus.MarkNonUrlFields())) + rField.GetFieldColor() = GetColorConfig().GetColorValue( svtools::WRITERFIELDSHADINGS ).nColor; + } const OUString aFldValue = GetEditEnginePtr()->CalcFieldValue( diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index afadc820687b..631893e8326c 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3182,7 +3182,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po pDXArray = pLine->GetCharPosArray().data() + (nIndex - pLine->GetStart()); // Paint control characters (#i55716#) - if ( aStatus.MarkFields() ) + /* XXX: Given that there's special handling + * only for some specific characters + * (U+200B ZERO WIDTH SPACE and U+2060 WORD + * JOINER) it is assumed to be not relevant + * for MarkUrlFields(). */ + if ( aStatus.MarkNonUrlFields() ) { sal_Int32 nTmpIdx; const sal_Int32 nTmpEnd = nTextStart + rTextPortion.GetLen(); |