From 555d702903fb0857122024e1ab78a72d122d3f16 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 26 Mar 2003 17:07:02 +0000 Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD --- sc/source/ui/unoobj/cellsuno.cxx | 9 ++-- sc/source/ui/unoobj/datauno.cxx | 65 ++++++++++++++--------- sc/source/ui/unoobj/defltuno.cxx | 8 +-- sc/source/ui/unoobj/fielduno.cxx | 8 +-- sc/source/ui/unoobj/shapeuno.cxx | 67 ++++++++++++++++++------ sc/source/ui/unoobj/srchuno.cxx | 6 ++- sc/source/ui/unoobj/unodoc.cxx | 109 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 215 insertions(+), 57 deletions(-) create mode 100644 sc/source/ui/unoobj/unodoc.cxx (limited to 'sc/source/ui/unoobj') diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 6301a26d51af..0684a89e5e85 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cellsuno.cxx,v $ * - * $Revision: 1.76 $ + * $Revision: 1.77 $ * - * last change: $Author: sab $ $Date: 2002-10-31 11:23:47 $ + * last change: $Author: hr $ $Date: 2003-03-26 18:06:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1421,11 +1421,14 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRangeList& rR) : ScCellRangesBase::~ScCellRangesBase() { - ForgetCurrentAttrs(); + // #107294# call RemoveUnoObject first, so no notification can happen + // during ForgetCurrentAttrs if (pDocShell) pDocShell->GetDocument()->RemoveUnoObject(*this); + ForgetCurrentAttrs(); + delete pValueListener; //! XChartDataChangeEventListener abmelden ?? diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 1c8041d99847..67fe2725f877 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: datauno.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: sab $ $Date: 2002-10-21 13:56:59 $ + * last change: $Author: hr $ $Date: 2003-03-26 18:06:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,9 @@ #ifndef SC_SCATTR_HXX #include "attrib.hxx" #endif +#ifndef _COMPHELPER_EXTRACT_HXX_ +#include +#endif using namespace com::sun::star; @@ -110,6 +113,7 @@ const SfxItemPropertyMap* lcl_GetSubTotalPropertyMap() { {MAP_CHAR_LEN(SC_UNONAME_BINDFMT), 0, &getBooleanCppuType(), 0}, {MAP_CHAR_LEN(SC_UNONAME_CASE), 0, &getBooleanCppuType(), 0}, + {MAP_CHAR_LEN(SC_UNONAME_ENABSORT), 0, &getBooleanCppuType(), 0}, {MAP_CHAR_LEN(SC_UNONAME_ENUSLIST), 0, &getBooleanCppuType(), 0}, {MAP_CHAR_LEN(SC_UNONAME_FORMATS), 0, &getBooleanCppuType(), 0}, {MAP_CHAR_LEN(SC_UNONAME_INSBRK), 0, &getBooleanCppuType(), 0}, @@ -327,7 +331,7 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ long ScSortDescriptor::GetPropertyCount() { - return 12; // TableSortDescriptor and SheetSortDescriptor + return 13; // TableSortDescriptor and SheetSortDescriptor } void ScSortDescriptor::FillProperties( uno::Sequence& rSeq, const ScSortParam& rParam ) @@ -367,38 +371,41 @@ void ScSortDescriptor::FillProperties( uno::Sequence& rSeq pArray[0].Name = rtl::OUString::createFromAscii( SC_UNONAME_ORIENT ); pArray[0].Value <<= eOrient; - pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_CONTHDR ); - ScUnoHelpFunctions::SetBoolInAny( pArray[1].Value, rParam.bHasHeader ); + pArray[1].Name = rtl::OUString::createFromAscii( SC_UNONAME_SORTCOLUMNS ); + pArray[1].Value = ::cppu::bool2any(!rParam.bByRow); + + pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_CONTHDR ); + ScUnoHelpFunctions::SetBoolInAny( pArray[2].Value, rParam.bHasHeader ); - pArray[2].Name = rtl::OUString::createFromAscii( SC_UNONAME_MAXFLD ); - pArray[2].Value <<= (sal_Int32) MAXSORT; + pArray[3].Name = rtl::OUString::createFromAscii( SC_UNONAME_MAXFLD ); + pArray[3].Value <<= (sal_Int32) MAXSORT; - pArray[3].Name = rtl::OUString::createFromAscii( SC_UNONAME_SORTFLD ); - pArray[3].Value <<= aFields; + pArray[4].Name = rtl::OUString::createFromAscii( SC_UNONAME_SORTFLD ); + pArray[4].Value <<= aFields; - pArray[4].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISCASE ); - ScUnoHelpFunctions::SetBoolInAny( pArray[4].Value, rParam.bCaseSens ); + pArray[5].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISCASE ); + ScUnoHelpFunctions::SetBoolInAny( pArray[5].Value, rParam.bCaseSens ); - pArray[5].Name = rtl::OUString::createFromAscii( SC_UNONAME_BINDFMT ); - ScUnoHelpFunctions::SetBoolInAny( pArray[5].Value, rParam.bIncludePattern ); + pArray[6].Name = rtl::OUString::createFromAscii( SC_UNONAME_BINDFMT ); + ScUnoHelpFunctions::SetBoolInAny( pArray[6].Value, rParam.bIncludePattern ); - pArray[6].Name = rtl::OUString::createFromAscii( SC_UNONAME_COPYOUT ); - ScUnoHelpFunctions::SetBoolInAny( pArray[6].Value, !rParam.bInplace ); + pArray[7].Name = rtl::OUString::createFromAscii( SC_UNONAME_COPYOUT ); + ScUnoHelpFunctions::SetBoolInAny( pArray[7].Value, !rParam.bInplace ); - pArray[7].Name = rtl::OUString::createFromAscii( SC_UNONAME_OUTPOS ); - pArray[7].Value <<= aOutPos; + pArray[8].Name = rtl::OUString::createFromAscii( SC_UNONAME_OUTPOS ); + pArray[8].Value <<= aOutPos; - pArray[8].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISULIST ); - ScUnoHelpFunctions::SetBoolInAny( pArray[8].Value, rParam.bUserDef ); + pArray[9].Name = rtl::OUString::createFromAscii( SC_UNONAME_ISULIST ); + ScUnoHelpFunctions::SetBoolInAny( pArray[9].Value, rParam.bUserDef ); - pArray[9].Name = rtl::OUString::createFromAscii( SC_UNONAME_UINDEX ); - pArray[9].Value <<= (sal_Int32) rParam.nUserIndex; + pArray[10].Name = rtl::OUString::createFromAscii( SC_UNONAME_UINDEX ); + pArray[10].Value <<= (sal_Int32) rParam.nUserIndex; - pArray[10].Name = rtl::OUString::createFromAscii( SC_UNONAME_COLLLOC ); - pArray[10].Value <<= rParam.aCollatorLocale; + pArray[11].Name = rtl::OUString::createFromAscii( SC_UNONAME_COLLLOC ); + pArray[11].Value <<= rParam.aCollatorLocale; - pArray[11].Name = rtl::OUString::createFromAscii( SC_UNONAME_COLLALG ); - pArray[11].Value <<= rtl::OUString( rParam.aCollatorAlgorithm ); + pArray[12].Name = rtl::OUString::createFromAscii( SC_UNONAME_COLLALG ); + pArray[12].Value <<= rtl::OUString( rParam.aCollatorAlgorithm ); } void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence& rSeq ) @@ -417,6 +424,10 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence -#endif - using namespace ::com::sun::star; //------------------------------------------------------------------------ diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index ac37a032e995..72a2500c8afd 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fielduno.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sab $ $Date: 2002-09-26 08:52:20 $ + * last change: $Author: hr $ $Date: 2003-03-26 18:06:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -984,8 +984,8 @@ ScHeaderFieldObj* ScHeaderFieldsObj::GetObjectByIndex_Impl(INT32 Index) const else if ( pData->ISA( SvxTableField ) ) nFieldType = SC_SERVICE_SHEETFIELD; } - ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Feld ist 1 Zeichen - return new ScHeaderFieldObj( pContentObj, nPart, nType, aSelection ); + ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field is 1 character + return new ScHeaderFieldObj( pContentObj, nPart, nFieldType, aSelection ); } return NULL; } diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index f6c79961e029..048e3e8f6362 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeuno.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: nn $ $Date: 2002-11-27 18:22:29 $ + * last change: $Author: hr $ $Date: 2003-03-26 18:06:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -396,13 +396,19 @@ beans::PropertyState SAL_CALL ScShapeObj::getPropertyState( const rtl::OUString& throw(beans::UnknownPropertyException, uno::RuntimeException) { ScUnoGuard aGuard; - - //! mix own and aggregated properties + String aNameString = aPropertyName; beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; - uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); - if ( xAggState.is() ) - eRet = xAggState->getPropertyState( aPropertyName ); + if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + { + // ImageMap is always "direct" + } + else + { + uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); + if ( xAggState.is() ) + eRet = xAggState->getPropertyState( aPropertyName ); + } return eRet; } @@ -427,12 +433,31 @@ void SAL_CALL ScShapeObj::setPropertyToDefault( const rtl::OUString& aPropertyNa throw(beans::UnknownPropertyException, uno::RuntimeException) { ScUnoGuard aGuard; + String aNameString = aPropertyName; - //! mix own and aggregated properties - - uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); - if ( xAggState.is() ) - xAggState->setPropertyToDefault( aPropertyName ); + if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + { + SdrObject* pObj = GetSdrObject(); + if ( pObj ) + { + ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo(pObj); + if( pIMapInfo ) + { + ImageMap aEmpty; + pIMapInfo->SetImageMap( aEmpty ); // replace with empty image map + } + else + { + // nothing to do (no need to insert user data for an empty map) + } + } + } + else + { + uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); + if ( xAggState.is() ) + xAggState->setPropertyToDefault( aPropertyName ); + } } uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const rtl::OUString& aPropertyName ) @@ -440,13 +465,21 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const rtl::OUString& aProperty uno::RuntimeException) { ScUnoGuard aGuard; - - //! mix own and aggregated properties + String aNameString = aPropertyName; uno::Any aAny; - uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); - if ( xAggState.is() ) - aAny = xAggState->getPropertyDefault( aPropertyName ); + if ( aNameString.EqualsAscii( SC_UNONAME_IMAGEMAP ) ) + { + // default: empty ImageMap + uno::Reference< uno::XInterface > xImageMap = SvUnoImageMap_createInstance( GetSupportedMacroItems() ); + aAny <<= uno::Reference< container::XIndexContainer >::query( xImageMap ); + } + else + { + uno::Reference xAggState = lcl_GetPropertyState(mxShapeAgg); + if ( xAggState.is() ) + aAny = xAggState->getPropertyDefault( aPropertyName ); + } return aAny; } diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index d963d1ea1182..c0b571d76df3 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: srchuno.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:45:08 $ + * last change: $Author: hr $ $Date: 2003-03-26 18:06:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -122,6 +122,8 @@ ScCellSearchObj::ScCellSearchObj() : // Defaults: pSearchItem->SetWordOnly(FALSE); pSearchItem->SetExact(FALSE); + pSearchItem->SetMatchFullHalfWidthForms(FALSE); + pSearchItem->SetUseAsianOptions(FALSE); // or all asian bits would have to be handled pSearchItem->SetBackward(FALSE); pSearchItem->SetSelection(FALSE); pSearchItem->SetRegExp(FALSE); diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx new file mode 100644 index 000000000000..1b4accf8d3b4 --- /dev/null +++ b/sc/source/ui/unoobj/unodoc.cxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: unodoc.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2003-03-26 18:06:45 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// System - Includes ----------------------------------------------------- + +#include +#include + +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include +#endif + +#include "scmod.hxx" + +using namespace ::com::sun::star; + +::rtl::OUString SAL_CALL ScDocument_getImplementationName() throw() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Calc.SpreadsheetDocument" ) ); +} + +uno::Sequence< rtl::OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw() +{ + uno::Sequence< rtl::OUString > aSeq( 2 ); + aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.OfficeDocument" )); + aSeq[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" )); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + // to create the service the SW_MOD should be already initialized + DBG_ASSERT( SC_MOD(), "No StarCalc module!" ); + + if ( SC_MOD() ) + { + ::rtl::OUString aFactoryURL( RTL_CONSTASCII_USTRINGPARAM ( "private:factory/scalc" ) ); + const SfxObjectFactory* pFactory = SfxObjectFactory::GetFactory( aFactoryURL ); + if ( pFactory ) + { + SfxObjectShell* pShell = pFactory->CreateObject(); + if( pShell ) + return uno::Reference< uno::XInterface >( pShell->GetModel() ); + } + } + + return uno::Reference< uno::XInterface >(); +} + + -- cgit