LCOV - code coverage report
Current view: top level - sc/source/ui/unoobj - afmtuno.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 355 392 90.6 %
Date: 2014-04-11 Functions: 49 67 73.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "scitems.hxx"
      21             : #include <editeng/memberids.hrc>
      22             : #include <tools/shl.hxx>
      23             : #include <svl/poolitem.hxx>
      24             : #include <vcl/svapp.hxx>
      25             : #include <svx/unomid.hxx>
      26             : #include "unowids.hxx"
      27             : #include <comphelper/servicehelper.hxx>
      28             : #include <com/sun/star/table/BorderLine.hpp>
      29             : #include <com/sun/star/table/CellVertJustify2.hpp>
      30             : #include <com/sun/star/table/ShadowLocation.hpp>
      31             : #include <com/sun/star/table/TableBorder.hpp>
      32             : #include <com/sun/star/table/ShadowFormat.hpp>
      33             : #include <com/sun/star/table/CellRangeAddress.hpp>
      34             : #include <com/sun/star/table/CellContentType.hpp>
      35             : #include <com/sun/star/table/TableOrientation.hpp>
      36             : #include <com/sun/star/table/CellHoriJustify.hpp>
      37             : #include <com/sun/star/util/SortField.hpp>
      38             : #include <com/sun/star/util/SortFieldType.hpp>
      39             : #include <com/sun/star/table/CellOrientation.hpp>
      40             : #include <com/sun/star/table/CellAddress.hpp>
      41             : #include <com/sun/star/awt/SimpleFontMetric.hpp>
      42             : #include <com/sun/star/awt/FontWeight.hpp>
      43             : #include <com/sun/star/awt/FontSlant.hpp>
      44             : #include <com/sun/star/awt/CharSet.hpp>
      45             : #include <com/sun/star/awt/FontDescriptor.hpp>
      46             : #include <com/sun/star/awt/FontWidth.hpp>
      47             : #include <com/sun/star/awt/XFont.hpp>
      48             : #include <com/sun/star/awt/FontType.hpp>
      49             : #include <com/sun/star/awt/FontUnderline.hpp>
      50             : #include <com/sun/star/awt/FontStrikeout.hpp>
      51             : #include <com/sun/star/awt/FontFamily.hpp>
      52             : #include <com/sun/star/awt/FontPitch.hpp>
      53             : 
      54             : #include "afmtuno.hxx"
      55             : #include "miscuno.hxx"
      56             : #include "autoform.hxx"
      57             : #include "scdll.hxx"
      58             : #include "unonames.hxx"
      59             : #include "cellsuno.hxx"
      60             : 
      61             : using namespace ::com::sun::star;
      62             : 
      63             : //  ein AutoFormat hat immer 16 Eintraege
      64             : #define SC_AF_FIELD_COUNT 16
      65             : 
      66             : //  AutoFormat-Map nur fuer PropertySetInfo, ohne Which-IDs
      67             : 
      68          27 : static const SfxItemPropertyMapEntry* lcl_GetAutoFormatMap()
      69             : {
      70             :     static const SfxItemPropertyMapEntry aAutoFormatMap_Impl[] =
      71             :     {
      72           1 :         { OUString(SC_UNONAME_INCBACK),  0,  ::getBooleanCppuType(),    0, 0 },
      73           1 :         { OUString(SC_UNONAME_INCBORD),  0,  ::getBooleanCppuType(),    0, 0 },
      74           1 :         { OUString(SC_UNONAME_INCFONT),  0,  ::getBooleanCppuType(),    0, 0 },
      75           1 :         { OUString(SC_UNONAME_INCJUST),  0,  ::getBooleanCppuType(),    0, 0 },
      76           1 :         { OUString(SC_UNONAME_INCNUM),   0,  ::getBooleanCppuType(),    0, 0 },
      77           1 :         { OUString(SC_UNONAME_INCWIDTH), 0,  ::getBooleanCppuType(),    0, 0 },
      78             :         { OUString(), 0, css::uno::Type(), 0, 0 }
      79          34 :     };
      80          27 :     return aAutoFormatMap_Impl;
      81             : }
      82             : 
      83             : //! Zahlformat (String/Language) ??? (in XNumberFormat nur ReadOnly)
      84             : //! table::TableBorder ??!?
      85             : 
      86           4 : static const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap()
      87             : {
      88             :     static const SfxItemPropertyMapEntry aAutoFieldMap_Impl[] =
      89             :     {
      90           1 :         {OUString(SC_UNONAME_CELLBACK), ATTR_BACKGROUND,        ::getCppuType((const sal_Int32*)0),        0, MID_BACK_COLOR },
      91           1 :         {OUString(SC_UNONAME_CCOLOR),   ATTR_FONT_COLOR,        ::getCppuType((const sal_Int32*)0),        0, 0 },
      92           1 :         {OUString(SC_UNONAME_COUTL),    ATTR_FONT_CONTOUR,      ::getBooleanCppuType(),                    0, 0 },
      93           1 :         {OUString(SC_UNONAME_CCROSS),   ATTR_FONT_CROSSEDOUT,   ::getBooleanCppuType(),                    0, MID_CROSSED_OUT },
      94           1 :         {OUString(SC_UNONAME_CFONT),    ATTR_FONT,              ::getCppuType((const sal_Int16*)0),        0, MID_FONT_FAMILY },
      95           1 :         {OUString(SC_UNONAME_CFCHARS),  ATTR_FONT,              ::getCppuType((sal_Int16*)0),              0, MID_FONT_CHAR_SET },
      96           1 :         {OUString(SC_UNO_CJK_CFCHARS),  ATTR_CJK_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_CHAR_SET },
      97           1 :         {OUString(SC_UNO_CTL_CFCHARS),  ATTR_CTL_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_CHAR_SET },
      98           1 :         {OUString(SC_UNONAME_CFFAMIL),  ATTR_FONT,              ::getCppuType((sal_Int16*)0),              0, MID_FONT_FAMILY },
      99           1 :         {OUString(SC_UNO_CJK_CFFAMIL),  ATTR_CJK_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_FAMILY },
     100           1 :         {OUString(SC_UNO_CTL_CFFAMIL),  ATTR_CTL_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_FAMILY },
     101           1 :         {OUString(SC_UNONAME_CFNAME),   ATTR_FONT,              ::getCppuType((OUString*)0),          0, MID_FONT_FAMILY_NAME },
     102           1 :         {OUString(SC_UNO_CJK_CFNAME),   ATTR_CJK_FONT,          ::getCppuType((OUString*)0),          0, MID_FONT_FAMILY_NAME },
     103           1 :         {OUString(SC_UNO_CTL_CFNAME),   ATTR_CTL_FONT,          ::getCppuType((OUString*)0),          0, MID_FONT_FAMILY_NAME },
     104           1 :         {OUString(SC_UNONAME_CFPITCH),  ATTR_FONT,              ::getCppuType((sal_Int16*)0),              0, MID_FONT_PITCH },
     105           1 :         {OUString(SC_UNO_CJK_CFPITCH),  ATTR_CJK_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_PITCH },
     106           1 :         {OUString(SC_UNO_CTL_CFPITCH),  ATTR_CTL_FONT,          ::getCppuType((sal_Int16*)0),              0, MID_FONT_PITCH },
     107           1 :         {OUString(SC_UNONAME_CFSTYLE),  ATTR_FONT,              ::getCppuType((OUString*)0),          0, MID_FONT_STYLE_NAME },
     108           1 :         {OUString(SC_UNO_CJK_CFSTYLE),  ATTR_CJK_FONT,          ::getCppuType((OUString*)0),          0, MID_FONT_STYLE_NAME },
     109           1 :         {OUString(SC_UNO_CTL_CFSTYLE),  ATTR_CTL_FONT,          ::getCppuType((OUString*)0),          0, MID_FONT_STYLE_NAME },
     110           1 :         {OUString(SC_UNONAME_CHEIGHT),  ATTR_FONT_HEIGHT,       ::getCppuType((float*)0),                  0, MID_FONTHEIGHT | CONVERT_TWIPS },
     111           1 :         {OUString(SC_UNO_CJK_CHEIGHT),  ATTR_CJK_FONT_HEIGHT,   ::getCppuType((float*)0),                  0, MID_FONTHEIGHT | CONVERT_TWIPS },
     112           1 :         {OUString(SC_UNO_CTL_CHEIGHT),  ATTR_CTL_FONT_HEIGHT,   ::getCppuType((float*)0),                  0, MID_FONTHEIGHT | CONVERT_TWIPS },
     113           1 :         {OUString(SC_UNONAME_COVER),    ATTR_FONT_OVERLINE,     ::getCppuType((const sal_Int16*)0),        0, MID_TL_STYLE },
     114           1 :         {OUString(SC_UNONAME_CPOST),    ATTR_FONT_POSTURE,      ::getCppuType((awt::FontSlant*)0),         0, MID_POSTURE },
     115           1 :         {OUString(SC_UNO_CJK_CPOST),    ATTR_CJK_FONT_POSTURE,  ::getCppuType((awt::FontSlant*)0),         0, MID_POSTURE },
     116           1 :         {OUString(SC_UNO_CTL_CPOST),    ATTR_CTL_FONT_POSTURE,  ::getCppuType((awt::FontSlant*)0),         0, MID_POSTURE },
     117           1 :         {OUString(SC_UNONAME_CSHADD),   ATTR_FONT_SHADOWED,     ::getBooleanCppuType(),                    0, 0 },
     118           1 :         {OUString(SC_UNONAME_TBLBORD),  SC_WID_UNO_TBLBORD,     ::getCppuType((table::TableBorder*)0),     0, 0 | CONVERT_TWIPS },
     119           1 :         {OUString(SC_UNONAME_TBLBORD2),  SC_WID_UNO_TBLBORD2,     ::getCppuType((table::TableBorder2*)0),     0, 0 | CONVERT_TWIPS },
     120           1 :         {OUString(SC_UNONAME_CUNDER),   ATTR_FONT_UNDERLINE,    ::getCppuType((const sal_Int16*)0),        0, MID_TL_STYLE },
     121           1 :         {OUString(SC_UNONAME_CWEIGHT),  ATTR_FONT_WEIGHT,       ::getCppuType((float*)0),                  0, MID_WEIGHT },
     122           1 :         {OUString(SC_UNO_CJK_CWEIGHT),  ATTR_CJK_FONT_WEIGHT,   ::getCppuType((float*)0),                  0, MID_WEIGHT },
     123           1 :         {OUString(SC_UNO_CTL_CWEIGHT),  ATTR_CTL_FONT_WEIGHT,   ::getCppuType((float*)0),                  0, MID_WEIGHT },
     124           1 :         {OUString(SC_UNONAME_CELLHJUS), ATTR_HOR_JUSTIFY,       ::getCppuType((const table::CellHoriJustify*)0),   0, 0 },
     125           1 :         {OUString(SC_UNONAME_CELLHJUS_METHOD), ATTR_HOR_JUSTIFY_METHOD, ::getCppuType((const sal_Int32*)0),   0, 0 },
     126           1 :         {OUString(SC_UNONAME_CELLTRAN), ATTR_BACKGROUND,        ::getBooleanCppuType(),                    0, MID_GRAPHIC_TRANSPARENT },
     127           1 :         {OUString(SC_UNONAME_WRAP),     ATTR_LINEBREAK,         ::getBooleanCppuType(),                    0, 0 },
     128           1 :         {OUString(SC_UNONAME_CELLORI),  ATTR_STACKED,           ::getCppuType((const table::CellOrientation*)0),   0, 0 },
     129           1 :         {OUString(SC_UNONAME_PBMARGIN), ATTR_MARGIN,            ::getCppuType((const sal_Int32*)0),        0, MID_MARGIN_LO_MARGIN | CONVERT_TWIPS },
     130           1 :         {OUString(SC_UNONAME_PLMARGIN), ATTR_MARGIN,            ::getCppuType((const sal_Int32*)0),        0, MID_MARGIN_L_MARGIN  | CONVERT_TWIPS },
     131           1 :         {OUString(SC_UNONAME_PRMARGIN), ATTR_MARGIN,            ::getCppuType((const sal_Int32*)0),        0, MID_MARGIN_R_MARGIN  | CONVERT_TWIPS },
     132           1 :         {OUString(SC_UNONAME_PTMARGIN), ATTR_MARGIN,            ::getCppuType((const sal_Int32*)0),        0, MID_MARGIN_UP_MARGIN | CONVERT_TWIPS },
     133           1 :         {OUString(SC_UNONAME_ROTANG),   ATTR_ROTATE_VALUE,      ::getCppuType((const sal_Int32*)0),        0, 0 },
     134           1 :         {OUString(SC_UNONAME_ROTREF),   ATTR_ROTATE_MODE,       ::getCppuType((const sal_Int32*)0),   0, 0 },
     135           1 :         {OUString(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY,       ::getCppuType((const sal_Int32*)0),   0, 0 },
     136           1 :         {OUString(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, ::getCppuType((const sal_Int32*)0),   0, 0 },
     137             :         { OUString(), 0, css::uno::Type(), 0, 0 }
     138          52 :     };
     139           4 :     return aAutoFieldMap_Impl;
     140             : }
     141             : 
     142             : #define SCAUTOFORMATSOBJ_SERVICE    "com.sun.star.sheet.TableAutoFormats"
     143             : 
     144           0 : SC_SIMPLE_SERVICE_INFO( ScAutoFormatFieldObj, "ScAutoFormatFieldObj", "com.sun.star.sheet.TableAutoFormatField" )
     145           2 : SC_SIMPLE_SERVICE_INFO( ScAutoFormatObj, "ScAutoFormatObj", "com.sun.star.sheet.TableAutoFormat" )
     146           0 : SC_SIMPLE_SERVICE_INFO( ScAutoFormatsObj, "ScAutoFormatsObj", SCAUTOFORMATSOBJ_SERVICE )
     147             : 
     148          11 : static bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const OUString& rName, sal_uInt16& rOutIndex )
     149             : {
     150          11 :     ScAutoFormat::const_iterator itBeg = rFormats.begin(), itEnd = rFormats.end();
     151         161 :     for (ScAutoFormat::const_iterator it = itBeg; it != itEnd; ++it)
     152             :     {
     153         155 :         const ScAutoFormatData* pEntry = it->second;
     154         155 :         const OUString& aEntryName = pEntry->GetName();
     155         155 :         if ( aEntryName.equals(rName) )
     156             :         {
     157           5 :             size_t nPos = std::distance(itBeg, it);
     158           5 :             rOutIndex = nPos;
     159           5 :             return true;
     160             :         }
     161             :     }
     162           6 :     return false;       // is nich
     163             : }
     164             : 
     165           1 : ScAutoFormatsObj::ScAutoFormatsObj()
     166             : {
     167             :     //! Dieses Objekt darf es nur einmal geben, und es muss an den Auto-Format-Daten
     168             :     //! bekannt sein, damit Aenderungen gebroadcasted werden koennen
     169           1 : }
     170             : 
     171           2 : ScAutoFormatsObj::~ScAutoFormatsObj()
     172             : {
     173           2 : }
     174             : 
     175             : // stuff for exService_...
     176             : 
     177           1 : uno::Reference<uno::XInterface> SAL_CALL ScAutoFormatsObj_CreateInstance(
     178             :                         const uno::Reference<lang::XMultiServiceFactory>& )
     179             : {
     180           1 :     SolarMutexGuard aGuard;
     181           1 :     ScDLL::Init();
     182           1 :     static uno::Reference< uno::XInterface > xInst((::cppu::OWeakObject*) new ScAutoFormatsObj);
     183           1 :     return xInst;
     184             : }
     185             : 
     186         131 : OUString ScAutoFormatsObj::getImplementationName_Static()
     187             : {
     188         131 :     return OUString( "stardiv.StarCalc.ScAutoFormatsObj" );
     189             : }
     190             : 
     191           1 : uno::Sequence<OUString> ScAutoFormatsObj::getSupportedServiceNames_Static()
     192             : {
     193           1 :     uno::Sequence<OUString> aRet(1);
     194           1 :     OUString* pArray = aRet.getArray();
     195           1 :     pArray[0] = OUString( SCAUTOFORMATSOBJ_SERVICE );
     196           1 :     return aRet;
     197             : }
     198             : 
     199             : // XTableAutoFormats
     200             : 
     201          26 : ScAutoFormatObj* ScAutoFormatsObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
     202             : {
     203          26 :     if (nIndex < ScGlobal::GetOrCreateAutoFormat()->size())
     204          24 :         return new ScAutoFormatObj(nIndex);
     205             : 
     206           2 :     return NULL;    // falscher Index
     207             : }
     208             : 
     209           2 : ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName)
     210             : {
     211           2 :     OUString aString(aName);
     212             :     sal_uInt16 nIndex;
     213           2 :     if (lcl_FindAutoFormatIndex(
     214           2 :             *ScGlobal::GetOrCreateAutoFormat(), aString, nIndex ))
     215           1 :         return GetObjectByIndex_Impl(nIndex);
     216           1 :     return NULL;
     217             : }
     218             : 
     219             : // container::XNameContainer
     220             : 
     221           3 : void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno::Any& aElement )
     222             :                             throw (lang::IllegalArgumentException, container::ElementExistException,
     223             :                                    lang::WrappedTargetException, uno::RuntimeException,
     224             :                                    std::exception)
     225             : {
     226           3 :     SolarMutexGuard aGuard;
     227           3 :     sal_Bool bDone = false;
     228             :     //  Reflection muss nicht uno::XInterface sein, kann auch irgendein Interface sein...
     229           6 :     uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
     230           3 :     if ( xInterface.is() )
     231             :     {
     232           2 :         ScAutoFormatObj* pFormatObj = ScAutoFormatObj::getImplementation( xInterface );
     233           2 :         if ( pFormatObj && !pFormatObj->IsInserted() )  // noch nicht eingefuegt?
     234             :         {
     235           2 :             OUString aNameStr(aName);
     236           2 :             ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     237             : 
     238             :             sal_uInt16 nDummy;
     239           2 :             if (!lcl_FindAutoFormatIndex( *pFormats, aNameStr, nDummy ))
     240             :             {
     241           1 :                 ScAutoFormatData* pNew = new ScAutoFormatData();
     242           1 :                 pNew->SetName( aNameStr );
     243             : 
     244           1 :                 if (pFormats->insert(pNew))
     245             :                 {
     246             :                     //! Notify fuer andere Objekte
     247           1 :                     pFormats->Save();   // sofort speichern
     248             : 
     249             :                     sal_uInt16 nNewIndex;
     250           1 :                     if (lcl_FindAutoFormatIndex( *pFormats, aNameStr, nNewIndex ))
     251             :                     {
     252           1 :                         pFormatObj->InitFormat( nNewIndex );    // kann jetzt benutzt werden
     253           1 :                         bDone = sal_True;
     254             :                     }
     255             :                 }
     256             :                 else
     257             :                 {
     258             :                     OSL_FAIL("AutoFormat konnte nicht eingefuegt werden");
     259           0 :                     throw uno::RuntimeException();
     260             :                 }
     261             :             }
     262             :             else
     263             :             {
     264           1 :                 throw container::ElementExistException();
     265           2 :             }
     266             :         }
     267             :     }
     268             : 
     269           2 :     if (!bDone)
     270             :     {
     271             :         //  other errors are handled above
     272           1 :         throw lang::IllegalArgumentException();
     273           3 :     }
     274           1 : }
     275             : 
     276           0 : void SAL_CALL ScAutoFormatsObj::replaceByName( const OUString& aName, const uno::Any& aElement )
     277             :                             throw(lang::IllegalArgumentException, container::NoSuchElementException,
     278             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     279             : {
     280           0 :     SolarMutexGuard aGuard;
     281             :     //! zusammenfassen?
     282           0 :     removeByName( aName );
     283           0 :     insertByName( aName, aElement );
     284           0 : }
     285             : 
     286           2 : void SAL_CALL ScAutoFormatsObj::removeByName( const OUString& aName )
     287             :                                 throw(container::NoSuchElementException,
     288             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     289             : {
     290           2 :     SolarMutexGuard aGuard;
     291           2 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     292             : 
     293           2 :     ScAutoFormat::iterator it = pFormats->find(aName);
     294           2 :     if (it != pFormats->end())
     295             :     {
     296           1 :         pFormats->erase(it);
     297             : 
     298             :         //! Notify fuer andere Objekte
     299           1 :         pFormats->Save();   // sofort speichern
     300             :     }
     301             :     else
     302             :     {
     303           1 :         throw container::NoSuchElementException();
     304           2 :     }
     305           1 : }
     306             : 
     307             : // container::XEnumerationAccess
     308             : 
     309           2 : uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatsObj::createEnumeration()
     310             :                                                     throw(uno::RuntimeException, std::exception)
     311             : {
     312           2 :     SolarMutexGuard aGuard;
     313           2 :     return new ScIndexEnumeration(this, OUString("com.sun.star.sheet.TableAutoFormatEnumeration"));
     314             : }
     315             : 
     316             : // container::XIndexAccess
     317             : 
     318          22 : sal_Int32 SAL_CALL ScAutoFormatsObj::getCount() throw(uno::RuntimeException, std::exception)
     319             : {
     320          22 :     SolarMutexGuard aGuard;
     321          22 :     return ScGlobal::GetOrCreateAutoFormat()->size();
     322             : }
     323             : 
     324          25 : uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 nIndex )
     325             :                             throw(lang::IndexOutOfBoundsException,
     326             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     327             : {
     328          25 :     SolarMutexGuard aGuard;
     329          50 :     uno::Reference< container::XNamed >  xFormat(GetObjectByIndex_Impl((sal_uInt16)nIndex));
     330          25 :     if (!xFormat.is())
     331           2 :         throw lang::IndexOutOfBoundsException();
     332          48 :     return uno::makeAny(xFormat);
     333             : }
     334             : 
     335           1 : uno::Type SAL_CALL ScAutoFormatsObj::getElementType() throw(uno::RuntimeException, std::exception)
     336             : {
     337           1 :     SolarMutexGuard aGuard;
     338           1 :     return ::getCppuType((const uno::Reference< container::XNamed >*)0);    // muss zu getByIndex passen
     339             : }
     340             : 
     341           1 : sal_Bool SAL_CALL ScAutoFormatsObj::hasElements() throw(uno::RuntimeException, std::exception)
     342             : {
     343           1 :     SolarMutexGuard aGuard;
     344           1 :     return ( getCount() != 0 );
     345             : }
     346             : 
     347             : // container::XNameAccess
     348             : 
     349           2 : uno::Any SAL_CALL ScAutoFormatsObj::getByName( const OUString& aName )
     350             :             throw(container::NoSuchElementException,
     351             :                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     352             : {
     353           2 :     SolarMutexGuard aGuard;
     354           4 :     uno::Reference< container::XNamed >  xFormat(GetObjectByName_Impl(aName));
     355           2 :     if (!xFormat.is())
     356           1 :         throw container::NoSuchElementException();
     357           3 :     return uno::makeAny(xFormat);
     358             : }
     359             : 
     360           4 : uno::Sequence<OUString> SAL_CALL ScAutoFormatsObj::getElementNames()
     361             :                                                 throw(uno::RuntimeException, std::exception)
     362             : {
     363           4 :     SolarMutexGuard aGuard;
     364           4 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     365           4 :     uno::Sequence<OUString> aSeq(pFormats->size());
     366           4 :     OUString* pAry = aSeq.getArray();
     367           4 :     ScAutoFormat::const_iterator it = pFormats->begin(), itEnd = pFormats->end();
     368          74 :     for (size_t i = 0; it != itEnd; ++it, ++i)
     369             :     {
     370          70 :         pAry[i] = it->second->GetName();
     371             :     }
     372           4 :     return aSeq;
     373             : }
     374             : 
     375           4 : sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const OUString& aName )
     376             :                                         throw(uno::RuntimeException, std::exception)
     377             : {
     378           4 :     SolarMutexGuard aGuard;
     379           8 :     OUString aString(aName);
     380             :     sal_uInt16 nDummy;
     381             :     return lcl_FindAutoFormatIndex(
     382           8 :         *ScGlobal::GetOrCreateAutoFormat(), aString, nDummy );
     383             : }
     384             : 
     385          27 : ScAutoFormatObj::ScAutoFormatObj(sal_uInt16 nIndex) :
     386             :     aPropSet( lcl_GetAutoFormatMap() ),
     387          27 :     nFormatIndex( nIndex )
     388             : {
     389             :     //! Listening !!!
     390          27 : }
     391             : 
     392          81 : ScAutoFormatObj::~ScAutoFormatObj()
     393             : {
     394             :     //  Wenn ein AutoFormat-Objekt losgelassen wird, werden eventuelle Aenderungen
     395             :     //  gespeichert, damit sie z.B. im Writer sichtbar sind
     396             : 
     397          27 :     if (IsInserted())
     398             :     {
     399          25 :         ScAutoFormat* pFormats = ScGlobal::GetAutoFormat();
     400          25 :         if ( pFormats && pFormats->IsSaveLater() )
     401           0 :             pFormats->Save();
     402             : 
     403             :         // Save() setzt SaveLater Flag zurueck
     404             :     }
     405          54 : }
     406             : 
     407           1 : void ScAutoFormatObj::InitFormat( sal_uInt16 nNewIndex )
     408             : {
     409             :     OSL_ENSURE( nFormatIndex == SC_AFMTOBJ_INVALID, "ScAutoFormatObj::InitFormat mehrfach" );
     410           1 :     nFormatIndex = nNewIndex;
     411             :     //! Listening !!!
     412           1 : }
     413             : 
     414             : // XUnoTunnel
     415             : 
     416           2 : sal_Int64 SAL_CALL ScAutoFormatObj::getSomething(
     417             :                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException, std::exception)
     418             : {
     419           4 :     if ( rId.getLength() == 16 &&
     420           2 :           0 == memcmp( getUnoTunnelId().getConstArray(),
     421           4 :                                     rId.getConstArray(), 16 ) )
     422             :     {
     423           2 :         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
     424             :     }
     425           0 :     return 0;
     426             : }
     427             : 
     428             : namespace
     429             : {
     430             :     class theScAutoFormatObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScAutoFormatObjUnoTunnelId> {};
     431             : }
     432             : 
     433           4 : const uno::Sequence<sal_Int8>& ScAutoFormatObj::getUnoTunnelId()
     434             : {
     435           4 :     return theScAutoFormatObjUnoTunnelId::get().getSeq();
     436             : }
     437             : 
     438           2 : ScAutoFormatObj* ScAutoFormatObj::getImplementation(
     439             :                         const uno::Reference<uno::XInterface> xObj )
     440             : {
     441           2 :     ScAutoFormatObj* pRet = NULL;
     442           2 :     uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
     443           2 :     if (xUT.is())
     444           2 :         pRet = reinterpret_cast<ScAutoFormatObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
     445           2 :     return pRet;
     446             : }
     447             : 
     448           0 : void ScAutoFormatObj::Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ )
     449             : {
     450             :     //  spaeter...
     451           0 : }
     452             : 
     453             : // XTableAutoFormat
     454             : 
     455           4 : ScAutoFormatFieldObj* ScAutoFormatObj::GetObjectByIndex_Impl(sal_uInt16 nIndex)
     456             : {
     457           4 :     if ( IsInserted() && nIndex < SC_AF_FIELD_COUNT )
     458           4 :         return new ScAutoFormatFieldObj( nFormatIndex, nIndex );
     459             : 
     460           0 :     return NULL;
     461             : }
     462             : 
     463             : // container::XEnumerationAccess
     464             : 
     465           1 : uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatObj::createEnumeration()
     466             :                                                     throw(uno::RuntimeException, std::exception)
     467             : {
     468           1 :     SolarMutexGuard aGuard;
     469           1 :     return new ScIndexEnumeration(this, OUString("com.sun.star.sheet.TableAutoFormatEnumeration"));
     470             : }
     471             : 
     472             : // container::XIndexAccess
     473             : 
     474           7 : sal_Int32 SAL_CALL ScAutoFormatObj::getCount() throw(uno::RuntimeException, std::exception)
     475             : {
     476           7 :     SolarMutexGuard aGuard;
     477           7 :     if (IsInserted())
     478           7 :         return SC_AF_FIELD_COUNT;   // immer 16 Elemente
     479             :     else
     480           0 :         return 0;
     481             : }
     482             : 
     483           5 : uno::Any SAL_CALL ScAutoFormatObj::getByIndex( sal_Int32 nIndex )
     484             :                             throw(lang::IndexOutOfBoundsException,
     485             :                                     lang::WrappedTargetException, uno::RuntimeException, std::exception)
     486             : {
     487           5 :     SolarMutexGuard aGuard;
     488             : 
     489           5 :     if ( nIndex < 0 || nIndex >= getCount() )
     490           1 :         throw lang::IndexOutOfBoundsException();
     491             : 
     492           4 :     if (IsInserted())
     493           4 :         return uno::makeAny(uno::Reference< beans::XPropertySet >(GetObjectByIndex_Impl((sal_uInt16)nIndex)));
     494           1 :     return uno::Any();
     495             : }
     496             : 
     497           1 : uno::Type SAL_CALL ScAutoFormatObj::getElementType() throw(uno::RuntimeException, std::exception)
     498             : {
     499           1 :     SolarMutexGuard aGuard;
     500           1 :     return ::getCppuType((const uno::Reference< beans::XPropertySet >*)0);  // muss zu getByIndex passen
     501             : }
     502             : 
     503           1 : sal_Bool SAL_CALL ScAutoFormatObj::hasElements() throw(uno::RuntimeException, std::exception)
     504             : {
     505           1 :     SolarMutexGuard aGuard;
     506           1 :     return ( getCount() != 0 );
     507             : }
     508             : 
     509             : // container::XNamed
     510             : 
     511           5 : OUString SAL_CALL ScAutoFormatObj::getName() throw(uno::RuntimeException, std::exception)
     512             : {
     513           5 :     SolarMutexGuard aGuard;
     514           5 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     515           5 :     if (IsInserted() && nFormatIndex < pFormats->size())
     516           5 :         return pFormats->findByIndex(nFormatIndex)->GetName();
     517             : 
     518           0 :     return OUString();
     519             : }
     520             : 
     521           2 : void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
     522             :     throw (uno::RuntimeException, std::exception)
     523             : {
     524           2 :     SolarMutexGuard aGuard;
     525           4 :     OUString aNewString(aNewName);
     526           2 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     527             : 
     528             :     sal_uInt16 nDummy;
     529           4 :     if (IsInserted() && nFormatIndex < pFormats->size() &&
     530           2 :         !lcl_FindAutoFormatIndex( *pFormats, aNewName, nDummy ))
     531             :     {
     532           2 :         ScAutoFormat::iterator it = pFormats->begin();
     533           2 :         std::advance(it, nFormatIndex);
     534           2 :         ScAutoFormatData* pData = it->second;
     535             :         OSL_ENSURE(pData,"AutoFormat Daten nicht da");
     536             : 
     537           2 :         ScAutoFormatData* pNew = new ScAutoFormatData(*pData);
     538           2 :         pNew->SetName( aNewString );
     539             : 
     540           2 :         pFormats->erase(it);
     541           2 :         if (pFormats->insert(pNew))
     542             :         {
     543           2 :             it = pFormats->find(pNew);
     544           2 :             ScAutoFormat::iterator itBeg = pFormats->begin();
     545           2 :             nFormatIndex = std::distance(itBeg, it);
     546             : 
     547             :             //! Notify fuer andere Objekte
     548           2 :             pFormats->SetSaveLater(true);
     549             :         }
     550             :         else
     551             :         {
     552             :             OSL_FAIL("AutoFormat konnte nicht eingefuegt werden");
     553           0 :             nFormatIndex = 0;       //! alter Index ist ungueltig
     554             :         }
     555             :     }
     556             :     else
     557             :     {
     558             :         //  not inserted or name exists
     559           0 :         throw uno::RuntimeException();
     560           2 :     }
     561           2 : }
     562             : 
     563             : // beans::XPropertySet
     564             : 
     565          13 : uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatObj::getPropertySetInfo()
     566             :                                                         throw(uno::RuntimeException, std::exception)
     567             : {
     568          13 :     SolarMutexGuard aGuard;
     569          13 :     static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
     570          13 :     return aRef;
     571             : }
     572             : 
     573          18 : void SAL_CALL ScAutoFormatObj::setPropertyValue(
     574             :                         const OUString& aPropertyName, const uno::Any& aValue )
     575             :                 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
     576             :                         lang::IllegalArgumentException, lang::WrappedTargetException,
     577             :                         uno::RuntimeException, std::exception)
     578             : {
     579          18 :     SolarMutexGuard aGuard;
     580          18 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     581          18 :     if (IsInserted() && nFormatIndex < pFormats->size())
     582             :     {
     583          18 :         ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex);
     584             :         OSL_ENSURE(pData,"AutoFormat Daten nicht da");
     585             : 
     586          18 :         OUString aPropString(aPropertyName);
     587          18 :         sal_Bool bBool = sal_Bool();
     588          18 :         if (aPropString.equalsAscii( SC_UNONAME_INCBACK ) && (aValue >>= bBool))
     589           3 :             pData->SetIncludeBackground( bBool );
     590          15 :         else if (aPropString.equalsAscii( SC_UNONAME_INCBORD ) && (aValue >>= bBool))
     591           3 :             pData->SetIncludeFrame( bBool );
     592          12 :         else if (aPropString.equalsAscii( SC_UNONAME_INCFONT ) && (aValue >>= bBool))
     593           3 :             pData->SetIncludeFont( bBool );
     594           9 :         else if (aPropString.equalsAscii( SC_UNONAME_INCJUST ) && (aValue >>= bBool))
     595           3 :             pData->SetIncludeJustify( bBool );
     596           6 :         else if (aPropString.equalsAscii( SC_UNONAME_INCNUM ) && (aValue >>= bBool))
     597           3 :             pData->SetIncludeValueFormat( bBool );
     598           3 :         else if (aPropString.equalsAscii( SC_UNONAME_INCWIDTH ) && (aValue >>= bBool))
     599           3 :             pData->SetIncludeWidthHeight( bBool );
     600             : 
     601             :         // else Fehler
     602             : 
     603             :         //! Notify fuer andere Objekte
     604          18 :         pFormats->SetSaveLater(true);
     605          18 :     }
     606          18 : }
     607             : 
     608          42 : uno::Any SAL_CALL ScAutoFormatObj::getPropertyValue( const OUString& aPropertyName )
     609             :                 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
     610             :                         uno::RuntimeException, std::exception)
     611             : {
     612          42 :     SolarMutexGuard aGuard;
     613          42 :     uno::Any aAny;
     614             : 
     615          42 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     616          42 :     if (IsInserted() && nFormatIndex < pFormats->size())
     617             :     {
     618          42 :         ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex);
     619             :         OSL_ENSURE(pData,"AutoFormat Daten nicht da");
     620             : 
     621             :         sal_Bool bValue;
     622          42 :         sal_Bool bError = false;
     623             : 
     624          42 :         if (aPropertyName.equalsAscii( SC_UNONAME_INCBACK ))
     625           7 :             bValue = pData->GetIncludeBackground();
     626          35 :         else if (aPropertyName.equalsAscii( SC_UNONAME_INCBORD ))
     627           7 :             bValue = pData->GetIncludeFrame();
     628          28 :         else if (aPropertyName.equalsAscii( SC_UNONAME_INCFONT ))
     629           7 :             bValue = pData->GetIncludeFont();
     630          21 :         else if (aPropertyName.equalsAscii( SC_UNONAME_INCJUST ))
     631           7 :             bValue = pData->GetIncludeJustify();
     632          14 :         else if (aPropertyName.equalsAscii( SC_UNONAME_INCNUM ))
     633           7 :             bValue = pData->GetIncludeValueFormat();
     634           7 :         else if (aPropertyName.equalsAscii( SC_UNONAME_INCWIDTH ))
     635           7 :             bValue = pData->GetIncludeWidthHeight();
     636             :         else
     637           0 :             bError = sal_True;      // unbekannte Property
     638             : 
     639          42 :         if (!bError)
     640          42 :             aAny <<= bValue;
     641             :     }
     642             : 
     643          42 :     return aAny;
     644             : }
     645             : 
     646           0 : SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAutoFormatObj )
     647             : 
     648           4 : ScAutoFormatFieldObj::ScAutoFormatFieldObj(sal_uInt16 nFormat, sal_uInt16 nField) :
     649             :     aPropSet( lcl_GetAutoFieldMap() ),
     650             :     nFormatIndex( nFormat ),
     651           4 :     nFieldIndex( nField )
     652             : {
     653             :     //! Listening !!!
     654           4 : }
     655             : 
     656           8 : ScAutoFormatFieldObj::~ScAutoFormatFieldObj()
     657             : {
     658           8 : }
     659             : 
     660           0 : void ScAutoFormatFieldObj::Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ )
     661             : {
     662             :     //  spaeter...
     663           0 : }
     664             : 
     665             : // beans::XPropertySet
     666             : 
     667           1 : uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatFieldObj::getPropertySetInfo()
     668             :                                                         throw(uno::RuntimeException, std::exception)
     669             : {
     670           1 :     SolarMutexGuard aGuard;
     671           1 :     static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
     672           1 :     return aRef;
     673             : }
     674             : 
     675          86 : void SAL_CALL ScAutoFormatFieldObj::setPropertyValue(
     676             :                         const OUString& aPropertyName, const uno::Any& aValue )
     677             :                 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
     678             :                         lang::IllegalArgumentException, lang::WrappedTargetException,
     679             :                         uno::RuntimeException, std::exception)
     680             : {
     681          86 :     SolarMutexGuard aGuard;
     682          86 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     683             :     const SfxItemPropertySimpleEntry* pEntry =
     684          86 :             aPropSet.getPropertyMap().getByName( aPropertyName );
     685             : 
     686          86 :     if ( pEntry && pEntry->nWID && nFormatIndex < pFormats->size() )
     687             :     {
     688          86 :         ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex);
     689             : 
     690          86 :         if ( IsScItemWid( pEntry->nWID ) )
     691             :         {
     692          84 :             if( const SfxPoolItem* pItem = pData->GetItem( nFieldIndex, pEntry->nWID ) )
     693             :             {
     694          84 :                 sal_Bool bDone = false;
     695             : 
     696          84 :                 switch( pEntry->nWID )
     697             :                 {
     698             :                     case ATTR_STACKED:
     699             :                     {
     700             :                         table::CellOrientation eOrient;
     701           2 :                         if( aValue >>= eOrient )
     702             :                         {
     703           2 :                             switch( eOrient )
     704             :                             {
     705             :                                 case table::CellOrientation_STANDARD:
     706           0 :                                     pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
     707           0 :                                 break;
     708             :                                 case table::CellOrientation_TOPBOTTOM:
     709           2 :                                     pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
     710           2 :                                     pData->PutItem( nFieldIndex, SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) );
     711           2 :                                 break;
     712             :                                 case table::CellOrientation_BOTTOMTOP:
     713           0 :                                     pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, false ) );
     714           0 :                                     pData->PutItem( nFieldIndex, SfxInt32Item( ATTR_ROTATE_VALUE, 9000 ) );
     715           0 :                                 break;
     716             :                                 case table::CellOrientation_STACKED:
     717           0 :                                     pData->PutItem( nFieldIndex, SfxBoolItem( ATTR_STACKED, true ) );
     718           0 :                                 break;
     719             :                                 default:
     720             :                                 {
     721             :                                     // added to avoid warnings
     722             :                                 }
     723             :                             }
     724           2 :                             bDone = sal_True;
     725             :                         }
     726             :                     }
     727           2 :                     break;
     728             :                     default:
     729          82 :                         SfxPoolItem* pNewItem = pItem->Clone();
     730          82 :                         bDone = pNewItem->PutValue( aValue, pEntry->nMemberId );
     731          82 :                         if (bDone)
     732          82 :                             pData->PutItem( nFieldIndex, *pNewItem );
     733          82 :                         delete pNewItem;
     734             :                 }
     735             : 
     736          84 :                 if (bDone)
     737             :                     //! Notify fuer andere Objekte?
     738          84 :                     pFormats->SetSaveLater(true);
     739             :             }
     740             :         }
     741             :         else
     742             :         {
     743           2 :             switch (pEntry->nWID)
     744             :             {
     745             :                 case SC_WID_UNO_TBLBORD:
     746             :                     {
     747           2 :                         table::TableBorder aBorder;
     748           2 :                         if ( aValue >>= aBorder )   // empty = nothing to do
     749             :                         {
     750           2 :                             SvxBoxItem aOuter(ATTR_BORDER);
     751           4 :                             SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
     752           2 :                             ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder );
     753           2 :                             pData->PutItem( nFieldIndex, aOuter );
     754             : 
     755             :                             //! Notify for other objects?
     756           4 :                             pFormats->SetSaveLater(true);
     757             :                         }
     758             :                     }
     759           2 :                     break;
     760             :                 case SC_WID_UNO_TBLBORD2:
     761             :                     {
     762           0 :                         table::TableBorder2 aBorder2;
     763           0 :                         if ( aValue >>= aBorder2 )   // empty = nothing to do
     764             :                         {
     765           0 :                             SvxBoxItem aOuter(ATTR_BORDER);
     766           0 :                             SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
     767           0 :                             ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder2 );
     768           0 :                             pData->PutItem( nFieldIndex, aOuter );
     769             : 
     770             :                             //! Notify for other objects?
     771           0 :                             pFormats->SetSaveLater(true);
     772             :                         }
     773             :                     }
     774           0 :                     break;
     775             :             }
     776             :         }
     777          86 :     }
     778          86 : }
     779             : 
     780         217 : uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPropertyName )
     781             :                 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
     782             :                         uno::RuntimeException, std::exception)
     783             : {
     784         217 :     SolarMutexGuard aGuard;
     785         217 :     uno::Any aVal;
     786             : 
     787         217 :     ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
     788             :     const SfxItemPropertySimpleEntry* pEntry =
     789         217 :             aPropSet.getPropertyMap().getByName( aPropertyName );
     790             : 
     791         217 :     if ( pEntry && pEntry->nWID && nFormatIndex < pFormats->size() )
     792             :     {
     793         217 :         const ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex);
     794             : 
     795         217 :         if ( IsScItemWid( pEntry->nWID ) )
     796             :         {
     797         211 :             if( const SfxPoolItem* pItem = pData->GetItem( nFieldIndex, pEntry->nWID ) )
     798             :             {
     799         209 :                 switch( pEntry->nWID )
     800             :                 {
     801             :                     case ATTR_STACKED:
     802             :                     {
     803           5 :                         const SfxInt32Item* pRotItem = (const SfxInt32Item*)pData->GetItem( nFieldIndex, ATTR_ROTATE_VALUE );
     804           5 :                         sal_Int32 nRot = pRotItem ? pRotItem->GetValue() : 0;
     805           5 :                         sal_Bool bStacked = ((const SfxBoolItem*)pItem)->GetValue();
     806           5 :                         SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aVal );
     807             :                     }
     808           5 :                     break;
     809             :                     default:
     810         204 :                         pItem->QueryValue( aVal, pEntry->nMemberId );
     811             :                 }
     812             :             }
     813             :         }
     814             :         else
     815             :         {
     816           6 :             switch (pEntry->nWID)
     817             :             {
     818             :                 case SC_WID_UNO_TBLBORD:
     819             :                 case SC_WID_UNO_TBLBORD2:
     820             :                     {
     821           6 :                         const SfxPoolItem* pItem = pData->GetItem(nFieldIndex, ATTR_BORDER);
     822           6 :                         if (pItem)
     823             :                         {
     824           6 :                             SvxBoxItem aOuter(*(static_cast<const SvxBoxItem*>(pItem)));
     825          12 :                             SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
     826             : 
     827           6 :                             if (pEntry->nWID == SC_WID_UNO_TBLBORD2)
     828           1 :                                 ScHelperFunctions::AssignTableBorder2ToAny( aVal, aOuter, aInner);
     829             :                             else
     830          11 :                                 ScHelperFunctions::AssignTableBorderToAny( aVal, aOuter, aInner);
     831             :                         }
     832             :                     }
     833           6 :                     break;
     834             :             }
     835             :         }
     836             :     }
     837             : 
     838         217 :     return aVal;
     839             : }
     840             : 
     841           0 : SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAutoFormatFieldObj )
     842             : 
     843             : 
     844             : 
     845             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10