[Libreoffice-commits] core.git: 2 commits - svl/source sw/qa sw/source
Ravindra Vidhate
ravindra.vidhate at synerzip.com
Tue May 20 01:54:13 PDT 2014
svl/source/numbers/zforfind.cxx | 20 +++++++++++++++++---
sw/qa/extras/ooxmlexport/data/fdo78659.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 +++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 2 +-
4 files changed, 27 insertions(+), 4 deletions(-)
New commits:
commit 1870ed0e4f63e9c58476e7dcd160e04eb866e0f5
Author: Ravindra Vidhate <ravindra.vidhate at synerzip.com>
Date: Thu May 15 16:12:23 2014 +0530
fdo#78659:FIle geting corrupted after Roundtrip due to fieldchar.
In a hyperlink, the field with fieldchartype="end" is getting addeded eventhough there is no begin for that field.
Change-Id: I50df6efc63fc9a66b146d4a861ae4bd654b4a3c6
Reviewed-on: https://gerrit.libreoffice.org/9368
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78659.docx b/sw/qa/extras/ooxmlexport/data/fdo78659.docx
new file mode 100644
index 0000000..55d6d08
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78659.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 7f3a5b7..f70f58d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3362,6 +3362,15 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78284, "fdo78284.docx")
"image/png");
}
+DECLARE_OOXMLEXPORT_TEST(testFDO78659, "fdo78659.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[8]/w:tr[6]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[3]/w:fldChar[1]", 0);
+}
+
DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 19807f4..6608149 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1866,7 +1866,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
bool DocxAttributeOutput::EndURL()
{
m_closeHyperlinkInThisRun = true;
- if(m_hyperLinkAnchor != "" && m_hyperLinkAnchor.startsWith("_Toc"))
+ if(m_startedHyperlink && m_hyperLinkAnchor != "" && m_hyperLinkAnchor.startsWith("_Toc"))
{
m_endPageRef = true;
}
commit 76531b80ea49e9665c628a2e5f8b82280ef80704
Author: Eike Rathke <erack at redhat.com>
Date: Tue May 20 10:49:02 2014 +0200
take a shortcut on common separating ASCII characters
Change-Id: I991801b9a0b7be6024612c8f29262f2ebd8e6a64
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index fef69c5..0385970 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -459,14 +459,28 @@ bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat,
* form? */
// Check simple ASCII first before invoking i18n or anything else.
- if (rtl::isAsciiAlphanumeric( rString[nPos] ))
+ const sal_Unicode c = rString[nPos];
+
+ // Common separating ASCII characters in date context.
+ switch (c)
+ {
+ case ' ':
+ case '-':
+ case '.':
+ case '/':
+ return true;
+ default:
+ ; // nothing
+ }
+
+ if (rtl::isAsciiAlphanumeric( c ))
return false; // Alpha or numeric is not word gap.
sal_Int32 nIndex = nPos;
- const sal_uInt32 c = rString.iterateCodePoints( &nIndex);
+ const sal_uInt32 uc = rString.iterateCodePoints( &nIndex);
if (nPos+1 < nIndex)
return true; // Surrogate, assume these to be new words.
- (void)c;
+ (void)uc;
const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( rString, nPos);
using namespace ::com::sun::star::i18n;
More information about the Libreoffice-commits
mailing list