Commits

Anonymous committed f6c4938 Merge

CWS-TOOLING: integrate CWS os146

  • Participants
  • Parent commits 8c62da5, a7371bd

Comments (0)

Files changed (17)

File cui/source/tabpages/page.cxx

 	ResStringArray aPaperAry( CUI_RES( nAryId ) );
 	sal_uInt32 nCnt = aPaperAry.Count();
 
+    sal_uInt16 nUserPos = LISTBOX_ENTRY_NOTFOUND;
 	for ( sal_uInt32 i = 0; i < nCnt; ++i )
 	{
 		String aStr = aPaperAry.GetString(i);
 
 		if ( eSize == ePaper )
 			nActPos = nPos;
+        if( eSize == PAPER_USER )
+            nUserPos = nPos;
 	}
-	// aktuelles Papierformat selektieren
-	aPaperSizeBox.SelectEntryPos( nActPos );
+	// preselect current paper format - #115915#: ePaper might not be in aPaperSizeBox so use PAPER_USER instead
+    aPaperSizeBox.SelectEntryPos( nActPos != LISTBOX_ENTRY_NOTFOUND ? nActPos : nUserPos );
 
     // Applikationsspezifisch
 

File editeng/inc/editeng/svxacorr.hxx

 	virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0;
 	virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt ) = 0;
 	virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt ) = 0;
+    virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt ) = 0;
 
 	virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
 							SfxPoolItem& ) = 0;

File editeng/source/editeng/edtspell.cxx

 
 sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt )
 {
+    return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+
+sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
 	// Eigentlich ein Replace einfuehren => Entspr. UNDO
-	sal_uInt16 nEnd = nPos+rTxt.Len();
+	sal_uInt16 nEnd = nPos+nSourceLength;
 	if ( nEnd > pCurNode->Len() )
 		nEnd = pCurNode->Len();
 
     // #i5925# First insert new text behind to be deleted text, for keeping attributes.
 	pImpEE->ImpInsertText( EditSelection( EditPaM( pCurNode, nEnd ) ), rTxt );
-	pImpEE->ImpDeleteSelection( EditSelection( EditPaM( pCurNode, nPos ), EditPaM( pCurNode, nEnd ) ) );
+    pImpEE->ImpDeleteSelection( EditSelection( EditPaM( pCurNode, nPos ), EditPaM( pCurNode, nEnd ) ) );
 
     if ( nPos == nCursor )
 		nCursor = nCursor + rTxt.Len();

File editeng/source/editeng/edtspell.hxx

 	virtual sal_Bool 	Delete( sal_uInt16 nStt, sal_uInt16 nEnd );
 	virtual sal_Bool 	Insert( sal_uInt16 nPos, const String& rTxt );
 	virtual sal_Bool 	Replace( sal_uInt16 nPos, const String& rTxt );
+    virtual sal_Bool    ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
 
 	virtual sal_Bool 	SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& );
 	virtual sal_Bool 	SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL );

File editeng/source/misc/svxacorr.cxx

 #include <com/sun/star/i18n/UnicodeType.hdl>
 #include <unotools/collatorwrapper.hxx>
 #include <com/sun/star/i18n/CollatorOptions.hpp>
+#include <com/sun/star/i18n/UnicodeScript.hpp>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/transliterationwrapper.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 			0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType);
 }
 
+bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const String& rTxt,
+				   		xub_StrLen nStt, xub_StrLen nEnd )
+{
+	for( ; nStt < nEnd; ++nStt )
+	{
+#if OSL_DEBUG_LEVEL > 1
+		sal_Int32 nCharType;
+		sal_Int32 nChType;
+		nCharType = rCC.getCharacterType( rTxt, nStt );
+		nChType = rCC.getType( rTxt, nStt );
+#endif
+        short nScript = rCC.getScript( rTxt, nStt );
+        switch( nScript )
+        {
+            case ::com::sun::star::i18n::UnicodeScript_kCJKRadicalsSupplement: 
+            case ::com::sun::star::i18n::UnicodeScript_kHangulJamo:
+            case ::com::sun::star::i18n::UnicodeScript_kCJKSymbolPunctuation:
+            case ::com::sun::star::i18n::UnicodeScript_kHiragana:
+            case ::com::sun::star::i18n::UnicodeScript_kKatakana:
+            case ::com::sun::star::i18n::UnicodeScript_kHangulCompatibilityJamo:
+            case ::com::sun::star::i18n::UnicodeScript_kEnclosedCJKLetterMonth:
+            case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibility:
+            case ::com::sun::star::i18n::UnicodeScript_k_CJKUnifiedIdeographsExtensionA:
+            case ::com::sun::star::i18n::UnicodeScript_kCJKUnifiedIdeograph:
+            case ::com::sun::star::i18n::UnicodeScript_kHangulSyllable:
+            case ::com::sun::star::i18n::UnicodeScript_kCJKCompatibilityIdeograph:
+            case ::com::sun::star::i18n::UnicodeScript_kHalfwidthFullwidthForm:
+                return true;
+            default: ; //do nothing 
+        }
+        
+	}
+	return false;
+}
+
 sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt,
 				   		xub_StrLen nStt, xub_StrLen nEnd )
 {
 			sal_Unicode cSave = rTxt.GetChar( nSttPos );
 			String sChar( cSave );
 			rCC.toLower( sChar );
-			if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ))
+			if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ))
 			{
 				if( SaveWordWrdSttLst & nFlags )
 					rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave );
 			String sChar( *pWordStt );
 			rCC.toUpper( sChar );
 			return  sChar != *pWordStt &&
-					rDoc.Replace( xub_StrLen( pWordStt - pStart ), sChar );
+					rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar );
 		}
 
 		aText = *pPrevPara;
 	nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() );
 	String sChar( cSave );
 	rCC.toUpper( sChar );
-	sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar );
+    sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar );
 
 	// das Wort will vielleicht jemand haben
 	if( bRet && SaveWordCplSttLst & nFlags )
 			eLang = MsLangId::getSystemLanguage();
 		CharClass& rCC = GetCharClass( eLang );
 
-		// Bug 19285: Symbolzeichen nicht anfassen
+		// no symbol characters
 		if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos ))
 			break;
             
 		else
 		{
 			nRet = 0;
-			// Grossbuchstabe am Satz-Anfang ??
-			if( IsAutoCorrFlag( CptlSttSntnc ) &&
-				FnCptlSttSntnc( rDoc, rTxt, sal_True, nCapLttrPos, nInsPos, eLang ) )
+			bool bUnsupported = lcl_IsUnsupportedUnicodeChar( rCC, rTxt, nCapLttrPos, nInsPos );
+            // Grossbuchstabe am Satz-Anfang ??
+			if( !bUnsupported &&
+                IsAutoCorrFlag( CptlSttSntnc ) &&
+                FnCptlSttSntnc( rDoc, rTxt, sal_True, nCapLttrPos, nInsPos, eLang ) )
 				nRet |= CptlSttSntnc;
 
 			// Zwei Grossbuchstaben am Wort-Anfang ??
-			if( IsAutoCorrFlag( CptlSttWrd ) &&
+			if( !bUnsupported &&
+                IsAutoCorrFlag( CptlSttWrd ) &&
 				FnCptlSttWrd( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) )
 				nRet |= CptlSttWrd;
 

File i18npool/source/paper/paper.cxx

File contents unchanged.

File svtools/source/filter.vcl/filter/FilterConfigItem.cxx

File contents unchanged.

File svx/source/dialog/svxruler.cxx

 				break;
 				}
 
-				for(int i  = nStartLimit; i >= nLimit; --i)
+                for(int i  = nStartLimit; i >= nLimit; --i)
 				{
 
 					long l = pBorders[i].nPos;
 		 const RulerType eType = GetDragType();
 		 nDragType = DRAG_OBJECT_SIZE_PROPORTIONAL;
          if( RULER_TYPE_TAB == eType ||
-             ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) &&
+             ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType || RULER_TYPE_MARGIN2 == eType) &&
                pColumnItem ) )  
 			 PrepareProportional_Impl(eType);
 		 break;

File sw/source/core/crsr/swcrsr.cxx

 	{
 		// Cursor als Kopie vom akt. und in den Ring aufnehmen
 		// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
-		SwCursor* pSav = Create( this ); 	// sicher den aktuellen Crsr
+		std::auto_ptr< SwCursor > pSav( Create( this ) ); 	// save the current cursor
 
 		// wenn schon ausserhalb vom Bodytext, suche von der Position,
 		// ansonsten beginne mit der 1. GrundSection
 				DeleteMark();
 			return 0;
 		}
+        pSav.release();
 
-		delete pSav;
 		if( !( FND_IN_SELALL & eFndRngs ))
 		{
 			// es sollte nur einer gesucht werden, also fuege in dazu
 	}
 	else if( FND_IN_SELALL & eFndRngs )
 	{
-		SwCursor* pSav = Create( this ); 	// sicher den aktuellen Crsr
+		::std::auto_ptr< SwCursor> pSav( Create( this ) ); 	// save the current cursor
 
 		const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs )
 							? rNds.GetEndOfContent().StartOfSectionNode()
 				DeleteMark();
 			return 0;
 		}
-		// es  wurde ein- bis mehrmals gefunden. Das steht alles
-		// im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf
-		delete pSav;
-
+        pSav.release();
 		while( GetNext() != this )
 			delete GetNext();
 

File sw/source/core/edit/acorrect.cxx

 
 sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
 {
+    return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
 	SwPaM* pPam = &rCrsr;
 	if( pPam->GetPoint()->nContent.GetIndex() != nPos )
 	{
 
 				pPam->SetMark();
 				pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
-											  xub_StrLen( nPos + rTxt.Len() ));
+											  xub_StrLen( nPos + nSourceLength ));
                 pDoc->ReplaceRange( *pPam, rTxt, false );
 				pPam->Exchange();
 				pPam->DeleteMark();
 			}
 		}
 		else
-			pDoc->Overwrite( *pPam, rTxt );
+        {
+            if( nSourceLength != rTxt.Len() )
+            {
+				pPam->SetMark();
+				pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
+											  xub_StrLen( nPos + nSourceLength ));
+                pDoc->ReplaceRange( *pPam, rTxt, false );
+				pPam->Exchange();
+				pPam->DeleteMark();
+            }
+			else
+                pDoc->Overwrite( *pPam, rTxt );
+        }
 
 //		pDoc->SetRedlineMode_intern( eOld );
         if( bUndoIdInitialized )

File sw/source/core/inc/acorrect.hxx

 	virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd );
 	virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt );
 	virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt );
+    virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
 
 	virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
 							SfxPoolItem& );

File sw/source/filter/ww8/rtfexport.cxx

 
 class SwRTFWriter : public Writer
 {
-       public:
+    bool        m_bOutOutlineOnly;
+    public:
                SwRTFWriter( const String& rFilterName, const String& rBaseURL );
                virtual ~SwRTFWriter();
                virtual sal_uLong WriteStream();
 };
 
-SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
     SetBaseURL( rBaseURL );
+	// export outline nodes, only (send outline to clipboard/presentation)
+	m_bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
 }
 
 SwRTFWriter::~SwRTFWriter()
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
     RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+    aExport.mbOutOutlineOnly =  m_bOutOutlineOnly;
     aExport.ExportDocument( true );
     return 0;
 }

File sw/source/filter/ww8/wrtw8nds.cxx

 {
     // Get the bookmarks for the normal run
     xub_StrLen nNextPos = aAttrIter->WhereNext();
-
-    GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
-
     xub_StrLen nNextBookmark = nNextPos;
-    NearestBookmark( nNextPos, nAktPos, false );
-
+
+    if( nNextBookmark > nAktPos )//no need to search for bookmarks otherwise
+    {
+        GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos );
+        NearestBookmark( nNextBookmark, nAktPos, false );
+    }
     return std::min( nNextPos, nNextBookmark );
 }
 
 {
     xub_StrLen nNextPos;
 
-    // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+    // go to next attribute if no bookmark is found and if the next attribute position if at the current position
     bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
-    if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
+    if( !bNextBookmark && nAktPos >= aAttrIter->WhereNext() )
         aAttrIter->NextPos();
 }
 
     switch ( rNode.GetNodeType() )
     {
         case ND_TEXTNODE:
-            OutputTextNode( *rNode.GetTxtNode() );
-            break;
+        {
+            const SwTxtNode& rTextNode = *rNode.GetTxtNode();
+            if( !mbOutOutlineOnly || rTextNode.IsOutline() )
+                OutputTextNode( rTextNode );
+        }
+        break;
         case ND_GRFNODE:
             OutputGrfNode( *rNode.GetGrfNode() );
             break;

File sw/source/filter/ww8/wrtww8.cxx

     pStyles( NULL ),
     bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
     mbExportModeRTF( false ),
+    mbOutOutlineOnly( false ),
     pDoc( pDocument ),
     pCurPam( pCurrentPam ),
     pOrigPam( pOriginalPam )

File sw/source/filter/ww8/wrtww8.hxx

     sal_uInt8 bSubstituteBullets : 1; // true: SubstituteBullet() gets called
     
     bool mbExportModeRTF;
+    bool mbOutOutlineOnly;   // export outline nodes, only (send outline to clipboard/presentation)
 
     SwDoc *pDoc;
     SwPaM *pCurPam, *pOrigPam;

File sw/source/ui/frmdlg/frmpage.cxx

 	aAtHorzPosFT.Enable( bEnable );
 	aAtHorzPosED.Enable( bEnable );
 
-    bEnable = nV == text::VertOrientation::NONE && !bFormat;
+    bEnable = nV == text::VertOrientation::NONE;
 	if ( !bEnable )
 	{
 		aAtVertPosED.SetValue( 0, FUNIT_TWIP );

File sw/source/ui/utlui/navipi.cxx

 					&aContentToolBox, SW_RES(NF_PAGE ));
 	pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
 	pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
-	pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
 	pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
+	pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+	pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+
 	bPageCtrlsVisible = sal_True;
 
 //	Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT);