ooo-build r13809 - in trunk: . patches/dev300



Author: thorstenb
Date: Fri Sep  5 13:51:26 2008
New Revision: 13809
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13809&view=rev

Log:
    * patches/dev300/apply:
    * patches/dev300/cws-impressfontsize.diff:
    * patches/dev300/cws-impressfontsize-m30.diff: adapted to partial
    integration into m31/m4.



Added:
   trunk/patches/dev300/cws-impressfontsize-m30.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/dev300/cws-impressfontsize.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri Sep  5 13:51:26 2008
@@ -2631,4 +2631,7 @@
 gnome-fpicker-main-thread.diff, i#93366, cmc
 
 [ ImpressFontSize ]
+[ Fixes <= dev300-m30 <= ooo300-m3 ]
+cws-impressfontsize-m30.diff, i#8824, cl
+[ Fixes > dev300-m30 > ooo300-m3 ]
 cws-impressfontsize.diff, i#8824, cl

Added: trunk/patches/dev300/cws-impressfontsize-m30.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/cws-impressfontsize-m30.diff	Fri Sep  5 13:51:26 2008
@@ -0,0 +1,647 @@
+ .../openoffice/Office/UI/DrawImpressCommands.xcu   |   19 ++
+ sd/sdi/drtxtob.sdi                                 |   11 +
+ sd/source/core/drawdoc3.cxx                        |   42 ++---
+ sd/source/ui/func/futext.cxx                       |   56 +++++++
+ sd/source/ui/inc/futext.hxx                        |    4 +
+ sd/source/ui/view/Outliner.cxx                     |    4 -
+ sd/source/ui/view/drtxtob.cxx                      |    7 +
+ sd/source/ui/view/drtxtob1.cxx                     |   20 ++-
+ sd/uiconfig/simpress/toolbar/textobjectbar.xml     |    2 
+ svx/inc/svx/editeng.hxx                            |    1 
+ svx/inc/svx/editview.hxx                           |    6 +
+ svx/inc/svx/svxids.hrc                             |    4 -
+ svx/sdi/svx.sdi                                    |   52 +++++++
+ svx/source/editeng/editeng.cxx                     |    1 
+ svx/source/editeng/editview.cxx                    |  155 ++++++++++++++++++++
+ 15 files changed, 351 insertions(+), 33 deletions(-)
+
+
+diff --git officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+index 2ede775..4272bc3 100644
+--- officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
++++ officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+@@ -2038,7 +2038,22 @@
+ 					<value>1</value>
+ 				</prop>
+ 			</node>
+-
+-		</node>
++      <node oor:name=".uno:Grow" oor:op="replace">
++        <prop oor:name="Label" oor:type="xs:string">
++          <value xml:lang="en-US">Increase Font</value>
++        </prop>
++        <prop oor:name="Properties" oor:type="xs:int">
++          <value>1</value>
++        </prop>
++      </node>
++      <node oor:name=".uno:Shrink" oor:op="replace">
++        <prop oor:name="Label" oor:type="xs:string">
++          <value xml:lang="en-US">Reduce Font</value>
++        </prop>
++        <prop oor:name="Properties" oor:type="xs:int">
++          <value>1</value>
++        </prop>
++      </node>
++    </node>
+ 	</node>
+ </oor:component-data>
+diff --git sd/sdi/drtxtob.sdi sd/sdi/drtxtob.sdi
+index ce6eb74..fa43626 100644
+--- sd/sdi/drtxtob.sdi
++++ sd/sdi/drtxtob.sdi
+@@ -186,4 +186,15 @@ shell TextObjectBar
+ 		ExecMethod = Execute;
+ 		StateMethod = GetAttrState;
+ 	]
++	SID_GROW_FONT_SIZE
++	[
++		ExecMethod = Execute;
++		StateMethod = GetAttrState;
++	]
++	SID_SHRINK_FONT_SIZE
++	[
++		ExecMethod = Execute;
++		StateMethod = GetAttrState;
++	]
++	
+ }
+diff --git sd/source/core/drawdoc3.cxx sd/source/core/drawdoc3.cxx
+index a50d736..56c4c6b 100644
+--- sd/source/core/drawdoc3.cxx
++++ sd/source/core/drawdoc3.cxx
+@@ -1251,43 +1251,39 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo)
+ 			const String aPicturePath( rStreamInfo.maUserData.GetToken( 1, ':' ) );
+ 
+ 			// graphic from picture stream in picture storage in XML package
+-			if( aPicturePath.GetTokenCount( '/' ) == 2 )
++			if( aPicturePath.GetTokenCount( '/' ) == 2 ) try
+ 			{
+ 				const String aPictureStreamName( aPicturePath.GetToken( 1, '/' ) );
+                 const String aPictureStorageName( aPicturePath.GetToken( 0, '/' ) );
+                 if( xStor->isStorageElement( aPictureStorageName )  )
+                 {
++					uno::Reference < embed::XStorage > xPictureStorage =
++							xStor->openStorageElement( aPictureStorageName, embed::ElementModes::READ );
+ 					try
+ 					{
+-						uno::Reference < embed::XStorage > xPictureStorage =
+-								xStor->openStorageElement( aPictureStorageName, embed::ElementModes::READ );
+-						try
+-						{
+-							if( xPictureStorage.is() && xPictureStorage->isStreamElement( aPictureStreamName ) )
+-							{
+-								uno::Reference < io::XStream > xStream = xPictureStorage->openStreamElement( aPictureStreamName, embed::ElementModes::READ );
+-								if( xStream.is() )
+-									pRet = ::utl::UcbStreamHelper::CreateStream( xStream );
+-							}
+-						}
+-						catch( container::NoSuchElementException& )
++						if( xPictureStorage.is() && xPictureStorage->isStreamElement( aPictureStreamName ) )
+ 						{
++							uno::Reference < io::XStream > xStream = xPictureStorage->openStreamElement( aPictureStreamName, embed::ElementModes::READ );
++							if( xStream.is() )
++								pRet = ::utl::UcbStreamHelper::CreateStream( xStream );
+ 						}
+ 					}
+-					catch( uno::Exception& e )
++					catch( container::NoSuchElementException& )
+ 					{
+-						(void)e;
+-						DBG_ERROR(
+-							(rtl::OString("sd::SdDrawDocument::GetDocumentStream(), "
+-									"exception caught: ") +
+-							rtl::OUStringToOString(
+-								comphelper::anyToString( cppu::getCaughtException() ),
+-								RTL_TEXTENCODING_UTF8 ) +
+-								rtl::OString("\r\nATTENTION: Graphics may get lost now, please inform CL or KA!") ).getStr() );
+ 					}
+                 }
+ 			}
+-
++			catch( uno::Exception& e )
++			{
++				(void)e;
++				DBG_ERROR(
++					(rtl::OString("sd::SdDrawDocument::GetDocumentStream(), "
++							"exception caught: ") +
++					rtl::OUStringToOString(
++						comphelper::anyToString( cppu::getCaughtException() ),
++						RTL_TEXTENCODING_UTF8 ) +
++						rtl::OString("\r\nATTENTION: Graphics may get lost now, please inform CL or KA!") ).getStr() );
++			}
+ 			rStreamInfo.mbDeleteAfterUse = ( pRet != NULL );
+ 		}
+ 	}
+diff --git sd/source/ui/func/futext.cxx sd/source/ui/func/futext.cxx
+index f06600f..76a11f8 100644
+--- sd/source/ui/func/futext.cxx
++++ sd/source/ui/func/futext.cxx
+@@ -68,6 +68,7 @@
+ #include <svx/frmdiritem.hxx>
+ 
+ #include <svx/svdetc.hxx>
++#include <svx/editview.hxx>
+ 
+ #include "sdresid.hxx"
+ #include "app.hrc"
+@@ -1487,5 +1488,60 @@ bool FuText::cancel()
+ 	}
+ }
+ 
++void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFontList, ::sd::View* pView )
++{
++    if( !pFontList || !pView )
++        return;
++
++    if( pOLV )
++    {
++        pOLV->GetEditView().ChangeFontSize( bGrow, pFontList );
++    }
++    else
++    {
++		SdDrawDocument* pDoc = pView->GetDoc();
++
++        const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
++        for( sal_uInt32 nMark = 0; nMark < rMarkList.GetMarkCount(); nMark++ )
++        {
++            SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( rMarkList.GetMark(nMark)->GetMarkedSdrObj() );
++            if( pTextObj )
++            {
++                for( sal_Int32 nText = 0; nText < pTextObj->getTextCount(); nText++ )
++                {
++                    pTextObj->setActiveText( nText );
++
++                    // Put text object into edit mode.
++                    SdrPageView* pPV = pView->GetSdrPageView();
++                    pView->SdrBeginTextEdit(pTextObj, pPV);
++
++                    pOLV = pView->GetTextEditOutlinerView();
++                    if( pOLV )
++                    {
++                        EditEngine* pEditEngine = pOLV->GetEditView().GetEditEngine();
++                        if( pEditEngine )
++                        {
++                            ESelection aSel;
++                            aSel.nEndPara = pEditEngine->GetParagraphCount()-1;
++                            aSel.nEndPos = pEditEngine->GetTextLen(aSel.nEndPara);
++                            pOLV->SetSelection(aSel);
++                        }
++
++                        ChangeFontSize( bGrow, pOLV, pFontList, pView );
++                    }
++
++                    pView->SdrEndTextEdit();
++                }
++
++                SfxItemSet aShapeSet( pTextObj->GetMergedItemSet() );
++                if( EditView::ChangeFontSize( bGrow, aShapeSet, pFontList ) )
++                {
++                    // todo
++                }
++            }
++        }                
++    }
++}
++
+ } // end of namespace sd
+ 
+diff --git sd/source/ui/inc/futext.hxx sd/source/ui/inc/futext.hxx
+index 216acab..7e110d5 100644
+--- sd/source/ui/inc/futext.hxx
++++ sd/source/ui/inc/futext.hxx
+@@ -40,6 +40,8 @@
+ struct StyleRequestData;
+ class SdrTextObj;
+ class OutlinerParaObject;
++class OutlinerView;
++class FontList;
+ 
+ namespace sd {
+ 
+@@ -87,6 +89,8 @@ public:
+ 	*/
+ 	virtual bool cancel();
+ 
++    static void ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFontList, ::sd::View* pView );
++
+ protected:
+ 	FuText (ViewShell* pViewSh, 
+         ::sd::Window* pWin, 
+diff --git sd/source/ui/view/Outliner.cxx sd/source/ui/view/Outliner.cxx
+index e75c7ca..0906ad7 100644
+--- sd/source/ui/view/Outliner.cxx
++++ sd/source/ui/view/Outliner.cxx
+@@ -33,8 +33,6 @@
+ 
+ #include "Outliner.hxx"
+ #include <vcl/wrkwin.hxx>
+-#include <svx/fontitem.hxx>
+-#include <svx/fhgtitem.hxx>
+ #include <sfx2/srchitem.hxx>
+ #include <svx/colritem.hxx>
+ #include <svx/eeitem.hxx>
+@@ -61,7 +59,7 @@
+ #include <svtools/linguprops.hxx>
+ #include <svtools/lingucfg.hxx>
+ #include <svx/editeng.hxx>
+-
++#include <vcl/metric.hxx>
+ #include <sfx2/viewfrm.hxx>
+ 
+ #include "strings.hrc"
+diff --git sd/source/ui/view/drtxtob.cxx sd/source/ui/view/drtxtob.cxx
+index b3bdc54..f9b5bea 100644
+--- sd/source/ui/view/drtxtob.cxx
++++ sd/source/ui/view/drtxtob.cxx
+@@ -376,6 +376,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
+ 			}
+ 			break;
+ 
++            case SID_GROW_FONT_SIZE:
++            case SID_SHRINK_FONT_SIZE:
++            {
++                // todo
++            }
++            break;
++
+ 			default:
+ 			break;
+ 		}
+diff --git sd/source/ui/view/drtxtob1.cxx sd/source/ui/view/drtxtob1.cxx
+index 0a5a2d9..de7c70d 100644
+--- sd/source/ui/view/drtxtob1.cxx
++++ sd/source/ui/view/drtxtob1.cxx
+@@ -63,6 +63,8 @@
+ #include <svx/xtable.hxx>
+ #include <svx/svdobj.hxx>
+ #include <svx/outlobj.hxx>
++#include <svx/flstitem.hxx>
++#include <svx/editeng.hxx>
+ #include <svtools/intitem.hxx>
+ #ifndef _SVX_SRIPTTYPEITEM_HXX //autogen
+ #include <svx/scripttypeitem.hxx>
+@@ -82,6 +84,9 @@
+ #include "OutlineView.hxx"
+ #include "Window.hxx"
+ #include "futempl.hxx"
++#include "DrawDocShell.hxx"
++#include "Outliner.hxx"
++#include "futext.hxx"
+ 
+ namespace sd {
+ 
+@@ -312,6 +317,20 @@ void TextObjectBar::Execute( SfxRequest &rReq )
+ 			    pOLV->ToggleBullets();
+ 		break;
+ 
++        case SID_GROW_FONT_SIZE:
++        case SID_SHRINK_FONT_SIZE:
++        {
++            const SvxFontListItem* pFonts =	(const SvxFontListItem*)mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST );
++            const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0;
++            if( pFontList )
++            {
++                FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView );
++                mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
++            }
++            rReq.Done();
++        }
++        break;
++
+ 
+ 		default:
+ 		{
+@@ -567,5 +586,4 @@ void TextObjectBar::Execute( SfxRequest &rReq )
+ 	Invalidate( SID_OUTLINE_DOWN );
+ }
+ 
+-
+ } // end of namespace sd
+diff --git sd/uiconfig/simpress/toolbar/textobjectbar.xml sd/uiconfig/simpress/toolbar/textobjectbar.xml
+index c3743f0..798b7ff 100644
+--- sd/uiconfig/simpress/toolbar/textobjectbar.xml
++++ sd/uiconfig/simpress/toolbar/textobjectbar.xml
+@@ -30,6 +30,8 @@
+  <toolbar:toolbaritem xlink:href=".uno:OutlineRight" toolbar:helpid="10153"/>
+  <toolbar:toolbaritem xlink:href=".uno:OutlineUp" toolbar:helpid="10150"/>
+  <toolbar:toolbaritem xlink:href=".uno:OutlineDown" toolbar:helpid="10151"/>
++ <toolbar:toolbaritem xlink:href=".uno:Grow" toolbar:helpid="helpid:20403"/>
++ <toolbar:toolbaritem xlink:href=".uno:Shrink" toolbar:helpid="helpid:20404"/>
+  <toolbar:toolbarseparator/>
+  <toolbar:toolbaritem xlink:href=".uno:TextdirectionLeftToRight" toolbar:helpid="10907"/>
+  <toolbar:toolbaritem xlink:href=".uno:TextdirectionTopToBottom" toolbar:helpid="10908"/>
+diff --git svx/inc/svx/editeng.hxx svx/inc/svx/editeng.hxx
+index 374fe16..f926da6 100644
+--- svx/inc/svx/editeng.hxx
++++ svx/inc/svx/editeng.hxx
+@@ -65,6 +65,7 @@ class SvxLRSpaceItem;
+ class SvKeyValueIterator;
+ class SvxForbiddenCharactersTable;
+ class SvxNumberFormat;
++class FontList;
+ 
+ #include <vos/ref.hxx>
+ #include <vector>
+diff --git svx/inc/svx/editview.hxx svx/inc/svx/editview.hxx
+index dd00913..f584b38 100644
+--- svx/inc/svx/editview.hxx
++++ svx/inc/svx/editview.hxx
+@@ -56,6 +56,7 @@ class SvStream;
+ class SvKeyValueIterator;
+ class SfxStyleSheet;
+ class Font;
++class FontList;
+ 
+ #ifndef _EDITDATA_HXX
+ #include <svx/editdata.hxx>
+@@ -236,6 +237,11 @@ public:
+ 
+ 	void			SetInvalidateMore( USHORT nPixel );
+ 	USHORT			GetInvalidateMore() const;
++
++    // grows or shrinks the font height for the current selection
++    void            ChangeFontSize( bool bGrow, const FontList* pList );
++
++    static bool ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList );
+ };
+ 
+ #endif // _MyEDITVIEW_HXX
+diff --git svx/inc/svx/svxids.hrc svx/inc/svx/svxids.hrc
+index 9c90b49..8d2ddb5 100644
+--- svx/inc/svx/svxids.hrc
++++ svx/inc/svx/svxids.hrc
+@@ -1291,8 +1291,8 @@
+ #define SID_PAPER_START                                 ( SID_SVX_START + 1039 )
+ #define SID_PAPER_END                                   ( SID_SVX_START + 1040 )
+ #define SID_COLLECT_LIST                                ( SID_SVX_START + 1041 )
+-// 1042: free
+-// 1043: free
++#define SID_GROW_FONT_SIZE								( SID_SVX_START + 1042 )
++#define SID_SHRINK_FONT_SIZE							( SID_SVX_START + 1043 )
+ // color subtoolbar on graphictoolbar
+ #define SID_COLOR_SETTINGS                              ( SID_SVX_START + 1044 )
+ #define SID_FM_MORE_CONTROLS                            ( SID_SVX_START + 1045 )
+diff --git svx/sdi/svx.sdi svx/sdi/svx.sdi
+index 449794c..f029668 100644
+--- svx/sdi/svx.sdi
++++ svx/sdi/svx.sdi
+@@ -14808,3 +14808,55 @@ SfxVoidItem FontDialogForParagraph SID_CHAR_DLG_FOR_PARAGRAPH
+     ToolBoxConfig = TRUE,
+     GroupId = GID_FORMAT;
+ ]
++
++//--------------------------------------------------------------------------
++
++SfxVoidItem Grow SID_GROW_FONT_SIZE
++()
++[
++	/* flags: */
++	AutoUpdate = TRUE,
++	Cachable = Cachable,
++	FastCall = FALSE,
++	HasCoreId = FALSE,
++	HasDialog = FALSE,
++	ReadOnlyDoc = FALSE,
++	Toggle = FALSE,
++	Container = FALSE,
++	RecordAbsolute = FALSE,
++	RecordPerSet;
++	Synchron;
++
++	/* config: */
++	AccelConfig = TRUE,
++	MenuConfig = FALSE,
++	StatusBarConfig = FALSE,
++	ToolBoxConfig = TRUE,
++	GroupId = GID_FORMAT;
++]
++
++//--------------------------------------------------------------------------
++
++SfxVoidItem Shrink SID_SHRINK_FONT_SIZE
++()
++[
++	/* flags: */
++	AutoUpdate = TRUE,
++	Cachable = Cachable,
++	FastCall = FALSE,
++	HasCoreId = FALSE,
++	HasDialog = FALSE,
++	ReadOnlyDoc = FALSE,
++	Toggle = FALSE,
++	Container = FALSE,
++	RecordAbsolute = FALSE,
++	RecordPerSet;
++	Synchron;
++
++	/* config: */
++	AccelConfig = TRUE,
++	MenuConfig = FALSE,
++	StatusBarConfig = FALSE,
++	ToolBoxConfig = TRUE,
++	GroupId = GID_FORMAT;
++]
+\ No newline at end of file
+diff --git svx/source/editeng/editeng.cxx svx/source/editeng/editeng.cxx
+index ab30e19..9d85692 100644
+--- svx/source/editeng/editeng.cxx
++++ svx/source/editeng/editeng.cxx
+@@ -38,6 +38,7 @@
+ #define _SVSTDARR_USHORTS
+ #include <svtools/svstdarr.hxx>
+ #include <svtools/ctloptions.hxx>
++#include <svtools/ctrltool.hxx>
+ 
+ #include <svx/svxfont.hxx>
+ #include <impedit.hxx>
+diff --git svx/source/editeng/editview.cxx svx/source/editeng/editview.cxx
+index 565b1f3..88ae8b6 100644
+--- svx/source/editeng/editview.cxx
++++ svx/source/editeng/editview.cxx
+@@ -32,14 +32,19 @@
+ #include "precompiled_svx.hxx"
+ #include <eeng_pch.hxx>
+ 
++#include <com/sun/star/i18n/WordType.hpp>
++#include <vcl/metric.hxx>
++
+ #define _SOLAR__PRIVATE 1
+ 
+ #include <i18npool/mslangid.hxx>
+ #include <svtools/languageoptions.hxx>
++#include <svtools/ctrltool.hxx>
+ 
+-#ifndef SVX_LIGHT
+ #include <sfx2/srchitem.hxx>
+-#endif
++
++#define _SVSTDARR_USHORTS
++#include <svtools/svstdarr.hxx>
+ 
+ #include <impedit.hxx>
+ #include <svx/editeng.hxx>
+@@ -47,6 +52,7 @@
+ #include <svx/flditem.hxx>
+ #include <svx/svxacorr.hxx>
+ #include <svx/langitem.hxx>
++#include <svx/fhgtitem.hxx>
+ #include <eerdll.hxx>
+ #include <eerdll2.hxx>
+ #include <editeng.hrc>
+@@ -57,6 +63,7 @@
+ #include <vcl/window.hxx>
+ #include <acorrcfg.hxx>
+ #include <unolingu.hxx>
++#include <fontitem.hxx>
+ 
+ #include <com/sun/star/frame/XStorable.hpp>
+ #include <com/sun/star/linguistic2/XDictionary1.hpp>
+@@ -1386,4 +1393,148 @@ sal_uInt16 EditView::GetInvalidateMore() const
+ 	return (sal_uInt16)pImpEditView->GetInvalidateMore();
+ }
+ 
++static void ChangeFontSizeImpl( EditView* pEditView, bool bGrow, const ESelection& rSel, const FontList* pFontList )
++{
++    pEditView->SetSelection( rSel );
++
++    SfxItemSet aSet( pEditView->GetAttribs() );
++    if( EditView::ChangeFontSize( bGrow, aSet, pFontList ) )
++    {
++        SfxItemSet aNewSet( pEditView->GetEmptyItemSet() );
++        aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT ), EE_CHAR_FONTHEIGHT );
++        pEditView->SetAttribs( aNewSet );
++    }
++}
+ 
++void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList )
++{
++	DBG_CHKTHIS( EditView, 0 );
++	DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
++
++    EditEngine& rEditEngine = *pImpEditView->pEditEngine;
++
++    ESelection aSel( GetSelection() );
++    ESelection aOldSelection( aSel );
++    aSel.Adjust();
++
++    if( !aSel.HasRange() )
++    {
++        aSel = rEditEngine.GetWord( aSel, com::sun::star::i18n::WordType::DICTIONARY_WORD );
++    }
++
++    if( aSel.HasRange() )
++    {
++        for( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
++        {
++            SvUShorts aPortions;
++            rEditEngine.GetPortions( nPara, aPortions );
++
++            if( aPortions.Count() == 0 )
++                aPortions.Insert( rEditEngine.GetTextLen(nPara), 0 );
++
++            const USHORT nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0;
++            const USHORT nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : 0xffff;
++
++            for ( USHORT nPos = 0; nPos < aPortions.Count(); ++nPos )
++            {
++                USHORT nPortionEnd   = aPortions.GetObject( nPos );
++                USHORT nPortionStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0;
++        
++                if( (nPortionEnd < nBeginPos) || (nPortionStart > nEndPos) )
++                    continue;
++
++                if( nPortionStart < nBeginPos )
++                    nPortionStart = nBeginPos;
++                if( nPortionEnd > nEndPos )
++                    nPortionEnd = nEndPos;
++
++                if( nPortionStart == nPortionEnd )
++                    continue;
++
++                ESelection aPortionSel( nPara, nPortionStart, nPara, nPortionEnd );
++                ChangeFontSizeImpl( this, bGrow, aPortionSel, pFontList );
++            }
++        }
++    }
++    else
++    {
++        ChangeFontSizeImpl( this, bGrow, aSel, pFontList );
++    }
++
++    SetSelection( aOldSelection );
++}
++
++bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList )
++{
++    SvxFontHeightItem aFontHeightItem( static_cast<const SvxFontHeightItem&>(rSet.Get( EE_CHAR_FONTHEIGHT )) );
++    long nHeight = aFontHeightItem.GetHeight();
++    const SfxMapUnit eUnit = rSet.GetPool()->GetMetric( EE_CHAR_FONTHEIGHT );
++    nHeight = OutputDevice::LogicToLogic( nHeight * 10, (MapUnit)eUnit, MAP_POINT );
++
++    const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(&rSet.Get( EE_CHAR_FONTINFO ));
++
++	if( pFontItem && pFontList )
++	{
++		FontInfo aFontInfo = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() );
++        const long* pAry = pFontList->GetSizeAry( aFontInfo );
++
++        if( bGrow )
++        {
++            while( *pAry )
++            {
++                if( *pAry > nHeight )
++                {
++                    nHeight = *pAry;
++                    break;
++                }
++                pAry++;                       
++            }
++
++            if( *pAry == 0 )
++            {
++                nHeight += (nHeight + 5) / 10;
++                if( nHeight > 9999 )
++                    nHeight = 9999;
++            }
++
++        }
++        else if( *pAry )
++        {
++            bool bFound = false;
++            if( *pAry < nHeight )
++            {
++                pAry++;
++                while( *pAry )
++                {
++                    if( *pAry >= nHeight )
++                    {
++                        nHeight = pAry[-1];
++                        bFound = true;
++                        break;
++                    }
++                    pAry++;
++                }
++            }
++
++            if( !bFound )
++            {
++                nHeight -= (nHeight + 5) / 10;
++                if( nHeight < 2 )
++                    nHeight = 2;
++            }
++        }
++    }
++
++    if( (nHeight >= 2) && (nHeight <= 9999 ) )
++    {
++        nHeight = OutputDevice::LogicToLogic( nHeight, MAP_POINT, (MapUnit)eUnit  ) / 10;
++
++        if( nHeight != (long)aFontHeightItem.GetHeight() )
++        {
++            aFontHeightItem.SetHeight( nHeight );
++            rSet.Put( aFontHeightItem, EE_CHAR_FONTHEIGHT );
++            return true;
++        }
++    }
++    return false;
++}

Modified: trunk/patches/dev300/cws-impressfontsize.diff
==============================================================================
--- trunk/patches/dev300/cws-impressfontsize.diff	(original)
+++ trunk/patches/dev300/cws-impressfontsize.diff	Fri Sep  5 13:51:26 2008
@@ -1,6 +1,5 @@
  .../openoffice/Office/UI/DrawImpressCommands.xcu   |   19 ++
  sd/sdi/drtxtob.sdi                                 |   11 +
- sd/source/core/drawdoc3.cxx                        |   42 ++---
  sd/source/ui/func/futext.cxx                       |   56 +++++++
  sd/source/ui/inc/futext.hxx                        |    4 +
  sd/source/ui/view/Outliner.cxx                     |    4 -
@@ -65,73 +64,6 @@
 +	]
 +	
  }
-diff --git sd/source/core/drawdoc3.cxx sd/source/core/drawdoc3.cxx
-index a50d736..56c4c6b 100644
---- sd/source/core/drawdoc3.cxx
-+++ sd/source/core/drawdoc3.cxx
-@@ -1251,43 +1251,39 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo)
- 			const String aPicturePath( rStreamInfo.maUserData.GetToken( 1, ':' ) );
- 
- 			// graphic from picture stream in picture storage in XML package
--			if( aPicturePath.GetTokenCount( '/' ) == 2 )
-+			if( aPicturePath.GetTokenCount( '/' ) == 2 ) try
- 			{
- 				const String aPictureStreamName( aPicturePath.GetToken( 1, '/' ) );
-                 const String aPictureStorageName( aPicturePath.GetToken( 0, '/' ) );
-                 if( xStor->isStorageElement( aPictureStorageName )  )
-                 {
-+					uno::Reference < embed::XStorage > xPictureStorage =
-+							xStor->openStorageElement( aPictureStorageName, embed::ElementModes::READ );
- 					try
- 					{
--						uno::Reference < embed::XStorage > xPictureStorage =
--								xStor->openStorageElement( aPictureStorageName, embed::ElementModes::READ );
--						try
--						{
--							if( xPictureStorage.is() && xPictureStorage->isStreamElement( aPictureStreamName ) )
--							{
--								uno::Reference < io::XStream > xStream = xPictureStorage->openStreamElement( aPictureStreamName, embed::ElementModes::READ );
--								if( xStream.is() )
--									pRet = ::utl::UcbStreamHelper::CreateStream( xStream );
--							}
--						}
--						catch( container::NoSuchElementException& )
-+						if( xPictureStorage.is() && xPictureStorage->isStreamElement( aPictureStreamName ) )
- 						{
-+							uno::Reference < io::XStream > xStream = xPictureStorage->openStreamElement( aPictureStreamName, embed::ElementModes::READ );
-+							if( xStream.is() )
-+								pRet = ::utl::UcbStreamHelper::CreateStream( xStream );
- 						}
- 					}
--					catch( uno::Exception& e )
-+					catch( container::NoSuchElementException& )
- 					{
--						(void)e;
--						DBG_ERROR(
--							(rtl::OString("sd::SdDrawDocument::GetDocumentStream(), "
--									"exception caught: ") +
--							rtl::OUStringToOString(
--								comphelper::anyToString( cppu::getCaughtException() ),
--								RTL_TEXTENCODING_UTF8 ) +
--								rtl::OString("\r\nATTENTION: Graphics may get lost now, please inform CL or KA!") ).getStr() );
- 					}
-                 }
- 			}
--
-+			catch( uno::Exception& e )
-+			{
-+				(void)e;
-+				DBG_ERROR(
-+					(rtl::OString("sd::SdDrawDocument::GetDocumentStream(), "
-+							"exception caught: ") +
-+					rtl::OUStringToOString(
-+						comphelper::anyToString( cppu::getCaughtException() ),
-+						RTL_TEXTENCODING_UTF8 ) +
-+						rtl::OString("\r\nATTENTION: Graphics may get lost now, please inform CL or KA!") ).getStr() );
-+			}
- 			rStreamInfo.mbDeleteAfterUse = ( pRet != NULL );
- 		}
- 	}
 diff --git sd/source/ui/func/futext.cxx sd/source/ui/func/futext.cxx
 index f06600f..76a11f8 100644
 --- sd/source/ui/func/futext.cxx



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]