summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-05-06 16:56:29 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-06 19:22:42 +0000
commit7ff50286bf7a8d99711388dfe7bb5ebeca4aa4d0 (patch)
tree39c491d0527fbba38b3dc67f1a8c6c385161a7bd
parentac2732bdc63fa687909fdf03e2a91081003f109e (diff)
tdf#86575 for OOXML write plain #REF! if deleted parts
(cherry picked from commit bb0ef99fb9dce30e99a7e9f7fa295a634d07b423) write the [#REF!] as defined in ODFF, tdf#86575 related ... if a part of the reference was deleted, instead of [.#REF!A1] Actually this is a regression that already can be tracked down to c54616f62bc70a9d39abf8837a9d7c3031c80a41 which changed things to use ValidAddress() only. (cherry picked from commit eeb203089f2ba6dffba9a2543c9a7e8bf551bbc5) 70f68722d7af02f6da3380c2dd9d54704c20b451 Change-Id: Ie3233d72bdbdd0ab82386c98a46755ce64ef3e7f Reviewed-on: https://gerrit.libreoffice.org/24705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/core/tool/compiler.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 9d272197c06d..a841c804b9a3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -1023,7 +1023,8 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1
if( !bSingleRef )
aAbs2 = rRef.Ref2.toAbs(rPos);
- if (FormulaGrammar::isODFF(eGram) && (!ValidAddress(aAbs1) || !ValidAddress(aAbs2)))
+ if (FormulaGrammar::isODFF(eGram) && (rRef.Ref1.IsDeleted() || !ValidAddress(aAbs1) ||
+ (!bSingleRef && (rRef.Ref2.IsDeleted() || !ValidAddress(aAbs2)))))
{
rBuffer.append(rErrRef);
// For ODFF write [#REF!], but not for PODF so apps reading ODF
@@ -1421,6 +1422,14 @@ struct ConventionXL_OOX : public ConventionXL_A1
aPos.SetRow(0);
}
+ if (rRef.Ref1.IsDeleted() || (!bSingleRef && rRef.Ref2.IsDeleted()))
+ {
+ // For OOXML write plain "#REF!" instead of detailed sheet/col/row
+ // information.
+ rBuf.append(rErrRef);
+ return;
+ }
+
ConventionXL_A1::makeRefStr( rBuf, eGram, aPos, rErrRef, rTabNames, rRef, bSingleRef, bFromRangeName);
}