[Libreoffice-commits] .: 3 commits - qadevOOo/tests sc/qa sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Mon Dec 26 22:57:04 PST 2011
qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java | 14 ++++---
sc/qa/unoapi/knownissues.xcl | 4 ++
sc/qa/unoapi/sc.sce | 2 -
sc/source/core/tool/parclass.cxx | 39 ++++++++++----------
sc/source/ui/docshell/externalrefmgr.cxx | 22 +++++++++++
5 files changed, 55 insertions(+), 26 deletions(-)
New commits:
commit 6fdac8946b09929fca54e40a2b630324ddda2aa0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 27 07:47:45 2011 +0100
fix ScDatabaseRangeObj test, fdo#43312
diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
index 8bd9675..eee4aa3 100644
--- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
+++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java
@@ -170,8 +170,10 @@ public class ScDatabaseRangeObj extends TestCase {
"Error getting test object from spreadsheet document", e);
}
- if (dbRanges.hasByName("dbRange")) {
- dbRanges.removeByName("dbRange");
+ String dbName = "dbRange";
+
+ if (dbRanges.hasByName(dbName)) {
+ dbRanges.removeByName(dbName);
}
@@ -185,22 +187,22 @@ public class ScDatabaseRangeObj extends TestCase {
try {
// we need to add it
- dbRanges.addNewByName("dbRanges",new CellRangeAddress((short)0, 0, 0, 0, 5));
+ dbRanges.addNewByName(dbName,new CellRangeAddress((short)0, 0, 0, 0, 5));
xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
dbrNA.getByName(
- "dbRange"));
+ dbName));
XCellRangeReferrer aReferrer = (XCellRangeReferrer) UnoRuntime.queryInterface(
XCellRangeReferrer.class,
- dbrNA.getByName("dbRange"));
+ dbrNA.getByName(dbName));
XCellRangeAddressable aRangeA = (XCellRangeAddressable) UnoRuntime.queryInterface(
XCellRangeAddressable.class,
aReferrer.getReferredCells());
aRange = aRangeA.getRangeAddress();
oObj = (XInterface) AnyConverter.toObject(
new Type(XInterface.class),
- dbrNA.getByName("dbRange"));
+ dbrNA.getByName(dbName));
} catch (com.sun.star.lang.WrappedTargetException e) {
e.printStackTrace(log);
throw new StatusException(
diff --git a/sc/qa/unoapi/knownissues.xcl b/sc/qa/unoapi/knownissues.xcl
index 0d614a9..5ae37df 100644
--- a/sc/qa/unoapi/knownissues.xcl
+++ b/sc/qa/unoapi/knownissues.xcl
@@ -219,3 +219,7 @@ sc.ScCellRangeObj::com::sun::star::chart::XChartData
### fdo43376 ###
sc.ScDDELinksObj
sc.ScDDELinkObj
+
+### fdo44167 ###
+sc.ScDatabaseRangeObj::com::sun::star::sheet::XDatabaseRange
+sc.ScDatabaseRangeObj::com::sun::star::util::XRefreshable
diff --git a/sc/qa/unoapi/sc.sce b/sc/qa/unoapi/sc.sce
index b35fdd0..dabb97a 100644
--- a/sc/qa/unoapi/sc.sce
+++ b/sc/qa/unoapi/sc.sce
@@ -48,7 +48,7 @@
-o sc.ScDataPilotItemsObj
-o sc.ScDataPilotTableObj
-o sc.ScDataPilotTablesObj
-# fdo43312 -o sc.ScDatabaseRangeObj
+-o sc.ScDatabaseRangeObj
# -o sc.ScDatabaseRangesObj
# -o sc.ScDocumentConfiguration
# -o sc.ScDrawPageObj
commit 32f38931ee5973b5db2255e1ee0c63b3a7b00831
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 27 07:37:02 2011 +0100
better handling for unsaved external references
Now references to unsaved documents can be created in the sheet and not
only through copy/paste
This fixes the problem that otherwise editing these refs resulted in
#REF
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index bec7700..536dea7 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2142,6 +2142,17 @@ const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return static_cast<ScDocShell*>(p)->GetDocument();
}
+ itrEnd = maUnsavedDocShells.end();
+ itr = maUnsavedDocShells.find(nFileId);
+ if (itr != itrEnd)
+ {
+ //document is unsaved document
+
+ SfxObjectShell* p = itr->second.maShell;
+ itr->second.maLastAccess = Time( Time::SYSTEM );
+ return static_cast<ScDocShell*>(p)->GetDocument();
+ }
+
const OUString* pFile = getExternalFileName(nFileId);
if (!pFile)
// no file name associated with this ID.
@@ -2356,6 +2367,17 @@ bool ScExternalRefManager::isOwnDocument(const OUString& rFile) const
void ScExternalRefManager::convertToAbsName(OUString& rFile) const
{
+ // unsaved documents have no AbsName
+ TypeId aType(TYPE(ScDocShell));
+ ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(&aType, false));
+ while (pShell)
+ {
+ if (rFile == rtl::OUString(pShell->GetName()))
+ return;
+
+ pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, &aType, false));
+ }
+
SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
rFile = ScGlobal::GetAbsDocName(rFile, pDocShell);
}
commit f36743fe31efaff4203a6728ab55bc694a012618
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Dec 27 03:37:37 2011 +0100
fix dbglevel=2 build in sc
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index e8f3784..d1e3664 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -465,8 +465,9 @@ void ScParameterClassification::GenerateDocumentation()
if ( xMap->getSymbol(eOp).Len() )
{
fprintf( stdout, "%s: ", aEnvVarName);
- ByteString aStr( xMap->getSymbol(eOp), RTL_TEXTENCODING_UTF8);
- aStr += "(";
+ rtl::OStringBuffer aStr;
+ aStr.append( rtl::OUStringToOString(rtl::OUString(xMap->getSymbol(eOp).GetBuffer()), RTL_TEXTENCODING_UTF8 ) );
+ aStr.append("(");
formula::FormulaByteToken aToken( eOp);
sal_uInt8 nParams = GetMinimumParameters( eOp);
// preset parameter count according to opcode value, with some
@@ -522,57 +523,57 @@ void ScParameterClassification::GenerateDocumentation()
for ( sal_uInt16 j=0; j < nParams; ++j )
{
if ( j > 0 )
- aStr += ",";
+ aStr.append(",");
Type eType = GetParameterType( &aToken, j);
switch ( eType )
{
case Value :
- aStr += " Value";
+ aStr.append(" Value");
break;
case Reference :
- aStr += " Reference";
+ aStr.append(" Reference");
break;
case Array :
- aStr += " Array";
+ aStr.append(" Array");
break;
case ForceArray :
- aStr += " ForceArray";
+ aStr.append(" ForceArray");
break;
case ReferenceOrForceArray :
- aStr += " ReferenceOrForceArray";
+ aStr.append(" ReferenceOrForceArray");
break;
case Bounds :
- aStr += " (Bounds, classification error?)";
+ aStr.append(" (Bounds, classification error?)");
break;
default:
- aStr += " (???, classification error?)";
+ aStr.append(" (???, classification error?)");
}
}
if ( HasRepeatParameters( eOp) )
- aStr += ", ...";
+ aStr.append(", ...");
if ( nParams )
- aStr += " ";
- aStr += ")";
+ aStr.append(" ");
+ aStr.append(")");
switch ( eOp )
{
case ocZGZ:
- aStr += " // RRI in English resource, but ZGZ in English-only section";
+ aStr.append(" // RRI in English resource, but ZGZ in English-only section");
break;
case ocMultiArea:
- aStr += " // e.g. combined first parameter of INDEX() function, not a real function";
+ aStr.append(" // e.g. combined first parameter of INDEX() function, not a real function");
break;
case ocBackSolver:
- aStr += " // goal seek via menu, not a real function";
+ aStr.append(" // goal seek via menu, not a real function");
break;
case ocTableOp:
- aStr += " // MULTIPLE.OPERATIONS in English resource, but TABLE in English-only section";
+ aStr.append(" // MULTIPLE.OPERATIONS in English resource, but TABLE in English-only section");
break;
case ocNoName:
- aStr += " // error function, not a real function";
+ aStr.append(" // error function, not a real function");
break;
default:;
}
- fprintf( stdout, "%s\n", aStr.GetBuffer());
+ fprintf( stdout, "%s\n", aStr.makeStringAndClear().getStr());
}
}
fflush( stdout);
More information about the Libreoffice-commits
mailing list