Kaydet (Commit) 19af8cc5 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Evil hack to fix the UNO API failure.

We need a clean solution for this, but that will need a bit more
effort & thinking.

Change-Id: I I25d066fa0322cca9a15af1745a758b1aba981e13
üst 921dce61
......@@ -54,6 +54,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
JunitTest_sc_complex \
JunitTest_sc_unoapi \
CppunitTest_sc_chart_regression_test \
CppunitTest_sc_annotationshapeobj \
CppunitTest_sc_cellrangeobj \
$(if $(filter-out $(OS),IOS), \
CppunitTest_sc_databaserangeobj) \
......
......@@ -15,7 +15,7 @@
-o sc.ScAccessiblePreviewTable
# fdo#45337 -o sc.ScAccessibleSpreadsheet
-o sc.ScAnnotationObj
# FIXME -o sc.ScAnnotationShapeObj
-o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
......
......@@ -42,6 +42,7 @@
#include "hints.hxx"
#include "editsrc.hxx"
#include "miscuno.hxx"
#include "fielduno.hxx"
// setVisible:
#include <svx/svdundo.hxx>
......@@ -50,6 +51,7 @@
#include "undocell.hxx"
#include "userdat.hxx"
#include <editeng/outlobj.hxx>
#include "editeng/unofield.hxx"
#include <svx/unoshape.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svditer.hxx>
......@@ -390,7 +392,49 @@ void SAL_CALL ScAnnotationShapeObj::insertTextContent( const uno::Reference< tex
{
SolarMutexGuard aGuard;
GetUnoText().insertTextContent( xRange, xContent, bAbsorb );
// Evil hack to convert a ScEditFieldObj based text field into a
// SvxUnoTextField based one. See SvxUnoTextBase::insertTextContent() for
// the reason why. We need a clean solution for this.
ScEditFieldObj* pField = ScEditFieldObj::getImplementation(xContent);
uno::Reference<text::XTextContent> xContent2 = xContent;
if (pField)
{
switch (pField->GetFieldType())
{
case ScEditFieldObj::Date:
xContent2.set(new SvxUnoTextField(ID_DATEFIELD));
break;
case ScEditFieldObj::File:
xContent2.set(new SvxUnoTextField(ID_EXT_FILEFIELD));
break;
case ScEditFieldObj::Page:
xContent2.set(new SvxUnoTextField(ID_PAGEFIELD));
break;
case ScEditFieldObj::Pages:
xContent2.set(new SvxUnoTextField(ID_PAGESFIELD));
break;
case ScEditFieldObj::Sheet:
xContent2.set(new SvxUnoTextField(ID_TABLEFIELD));
break;
case ScEditFieldObj::Time:
xContent2.set(new SvxUnoTextField(ID_TIMEFIELD));
break;
case ScEditFieldObj::ExtTime:
xContent2.set(new SvxUnoTextField(ID_EXT_TIMEFIELD));
break;
case ScEditFieldObj::Title:
xContent2.set(new SvxUnoTextField(ID_FILEFIELD));
break;
case ScEditFieldObj::URL:
xContent2.set(new SvxUnoTextField(ID_URLFIELD));
break;
default:
;
}
}
GetUnoText().insertTextContent(xRange, xContent2, bAbsorb);
}
void SAL_CALL ScAnnotationShapeObj::removeTextContent( const uno::Reference< text::XTextContent >& xContent )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment