View | Details | Raw Unified | Return to issue 115580
Collapse All | Expand All

(-)editeng/source/editeng/impedit4.cxx (-1 / +53 lines)
Lines 1241-1246 Link Here
1241
	EditSelection aSel( aPaM, aPaM );
1241
	EditSelection aSel( aPaM, aPaM );
1242
	DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" );
1242
	DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" );
1243
1243
1244
	//#115580#
1245
	EditPaM aStart1PaM( aSel.Min().GetNode(), aSel.Min().GetIndex() );
1246
	aSel = ImpInsertParaBreak( aSel );
1247
	EditPaM aStart2PaM = aSel.Min();
1248
	EditPaM aEnd1PaM( ImpInsertParaBreak( aSel.Max() ) );
1249
	aEnd1PaM.GetNode()->SetStyleSheet( aStart1PaM.GetNode()->GetStyleSheet(), sal_False );
1250
1244
	sal_Bool bUsePortionInfo = sal_False;
1251
	sal_Bool bUsePortionInfo = sal_False;
1245
//	sal_Bool bFields = sal_False;
1252
//	sal_Bool bFields = sal_False;
1246
	XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo();
1253
	XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo();
Lines 1270-1275 Link Here
1270
	for ( sal_uInt16 n = 0; n < nContents; n++, nPara++ )
1277
	for ( sal_uInt16 n = 0; n < nContents; n++, nPara++ )
1271
	{
1278
	{
1272
		ContentInfo* pC = rTextObject.GetContents().GetObject( n );
1279
		ContentInfo* pC = rTextObject.GetContents().GetObject( n );
1280
1281
		if ( bIsPasting ) 	//#115580#
1282
		{
1283
			if ( !n )
1284
				aPaM = aStart2PaM;
1285
			//init node
1286
			aPaM.GetNode()->SetStyleSheet( aStart1PaM.GetNode()->GetStyleSheet(), sal_False );
1287
			aPaM.GetNode()->GetContentAttribs().GetItems().ClearItem();
1288
			aPaM.GetNode()->GetCharAttribs().Clear();
1289
		}
1290
1273
		sal_Bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True;
1291
		sal_Bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True;
1274
		sal_uInt16 nStartPos = aPaM.GetIndex();
1292
		sal_uInt16 nStartPos = aPaM.GetIndex();
1275
1293
Lines 1340-1345 Link Here
1340
			    // nur dann Style und ParaAttribs, wenn neuer Absatz, oder
1358
			    // nur dann Style und ParaAttribs, wenn neuer Absatz, oder
1341
			    // komplett inneliegender...
1359
			    // komplett inneliegender...
1342
			    bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False;
1360
			    bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False;
1361
1362
			    if ( bIsPasting )	//#115580#
1363
			    {
1364
				    nPara = aEditDoc.GetPos( aPaM.GetNode() );
1365
				    if ( GetStyleSheetPool() && pC->GetStyle().Len() )
1366
				    {
1367
					SfxStyleSheet* pStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() );
1368
					DBG_ASSERT( pStyle, "InsertBinTextObject - Style not found!" );
1369
					SetStyleSheet( nPara, pStyle );
1370
				    }
1371
			    }
1372
			    else
1343
			    if ( GetStyleSheetPool() && pC->GetStyle().Len() )
1373
			    if ( GetStyleSheetPool() && pC->GetStyle().Len() )
1344
			    {
1374
			    {
1345
				    SfxStyleSheet* pStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() );
1375
				    SfxStyleSheet* pStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() );
Lines 1412-1417 Link Here
1412
		}
1442
		}
1413
#endif // !SVX_LIGHT
1443
#endif // !SVX_LIGHT
1414
1444
1445
		if ( bIsPasting )	//#115580#
1446
		{
1447
			AdjustParaAttribsByStyleSheet( aPaM.GetNode() );
1448
			ParaAttribsToCharAttribs( aPaM.GetNode() );
1449
		}
1450
	
1415
		// Zeilenumbruch, wenn weitere folgen...
1451
		// Zeilenumbruch, wenn weitere folgen...
1416
		if ( n < ( nContents-1) )
1452
		if ( n < ( nContents-1) )
1417
		{
1453
		{
Lines 1422-1428 Link Here
1422
		}
1458
		}
1423
	}
1459
	}
1424
1460
1425
	aSel.Max() = aPaM;
1461
	/* aSel.Max() = aPaM; */	//#115580#
1462
1463
	if ( bIsPasting )
1464
	{
1465
		EditPaM aEnd2PaM( aPaM );
1466
1467
		sal_Bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True;
1468
1469
		aSel.Min() = ImpConnectParagraphs( aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward );
1470
		bSpecialBackward = aEnd1PaM.GetNode()->Len() ? sal_True : sal_False;
1471
1472
		aSel.Max() = ImpConnectParagraphs( ( ( nContents == 1 ) ? aStart1PaM.GetNode() : aEnd2PaM.GetNode() ),
1473
																		aEnd1PaM.GetNode(), bSpecialBackward );
1474
	}
1475
	else
1476
		aSel.Max() = aPaM;
1477
	
1426
	DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" );
1478
	DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" );
1427
	return aSel;
1479
	return aSel;
1428
}
1480
}
(-)editeng/source/editeng/impedit5.cxx (+19 lines)
Lines 813-818 Link Here
813
	}
813
	}
814
}
814
}
815
815
816
void ImpEditEngine::AdjustParaAttribsByStyleSheet( ContentNode* pNode ) //#115580#
817
{
818
	if ( !pNode )
819
		return;
820
821
	SfxStyleSheet* pStyle = pNode->GetStyleSheet();
822
	for ( sal_uInt16 nWhich = EE_PARA_START; nWhich < EE_CHAR_START && pStyle; nWhich++ )
823
	{
824
		if ( pNode->GetContentAttribs().GetItems().GetItemState( nWhich ) == SFX_ITEM_ON   )
825
		{
826
			const SfxItemSet& rStyleAttribs = pStyle->GetItemSet();
827
			if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON )
828
				pNode->GetContentAttribs().GetItems().ClearItem( nWhich );	
829
		}
830
	}
831
}
832
816
void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode )
833
void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode )
817
{
834
{
818
	pNode->GetCharAttribs().DeleteEmptyAttribs( GetEditDoc().GetItemPool() );
835
	pNode->GetCharAttribs().DeleteEmptyAttribs( GetEditDoc().GetItemPool() );
Lines 841-846 Link Here
841
	}
858
	}
842
	bFormatted = sal_False;
859
	bFormatted = sal_False;
843
	// Portion braucht hier nicht invalidiert werden, geschieht woanders.
860
	// Portion braucht hier nicht invalidiert werden, geschieht woanders.
861
	if ( bIsPasting )	//#115580#
862
		pNode->GetContentAttribs().GetItems().ClearItem();
844
}
863
}
845
864
846
IdleFormattter::IdleFormattter()
865
IdleFormattter::IdleFormattter()
(-)editeng/source/editeng/impedit.hxx (+2 lines)
Lines 479-484 Link Here
479
	sal_Bool			bFormatted;
479
	sal_Bool			bFormatted;
480
	sal_Bool			bInSelection;
480
	sal_Bool			bInSelection;
481
	sal_Bool			bIsInUndo;
481
	sal_Bool			bIsInUndo;
482
	sal_Bool			bIsPasting; //#115580#	
482
	sal_Bool			bUpdate;
483
	sal_Bool			bUpdate;
483
	sal_Bool			bUndoEnabled;
484
	sal_Bool			bUndoEnabled;
484
	sal_Bool			bOwnerOfRefDev;
485
	sal_Bool			bOwnerOfRefDev;
Lines 543-548 Link Here
543
	void				SetParaAttrib( sal_uInt8 nFunc, EditSelection aSel, sal_uInt16 nValue );
544
	void				SetParaAttrib( sal_uInt8 nFunc, EditSelection aSel, sal_uInt16 nValue );
544
	sal_uInt16			GetParaAttrib( sal_uInt8 nFunc, EditSelection aSel );
545
	sal_uInt16			GetParaAttrib( sal_uInt8 nFunc, EditSelection aSel );
545
	void				SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem );
546
	void				SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem );
547
	void 				AdjustParaAttribsByStyleSheet( ContentNode* pNode ); //#115580#
546
	void				ParaAttribsToCharAttribs( ContentNode* pNode );
548
	void				ParaAttribsToCharAttribs( ContentNode* pNode );
547
	void				GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const;
549
	void				GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const;
548
550
(-)editeng/source/editeng/eertfpar.cxx (-5 / +48 lines)
Lines 108-114 Link Here
108
	EditPaM aStart2PaM = aCurSel.Min();
108
	EditPaM aStart2PaM = aCurSel.Min();
109
	// Sinnvoll oder nicht?:
109
	// Sinnvoll oder nicht?:
110
	aStart2PaM.GetNode()->GetContentAttribs().GetItems().ClearItem();
110
	aStart2PaM.GetNode()->GetContentAttribs().GetItems().ClearItem();
111
    AddRTFDefaultValues( aStart2PaM, aStart2PaM );
111
    //AddRTFDefaultValues( aStart2PaM, aStart2PaM ); //#115580#
112
	EditPaM aEnd1PaM( pImpEditEngine->ImpInsertParaBreak( aCurSel.Max() ) );
112
	EditPaM aEnd1PaM( pImpEditEngine->ImpInsertParaBreak( aCurSel.Max() ) );
113
	// aCurCel zeigt jetzt auf den Zwischenraum
113
	// aCurCel zeigt jetzt auf den Zwischenraum
114
114
Lines 136-141 Link Here
136
		aSel.Min() = EditPaM( pPrevNode, pPrevNode->Len() );
136
		aSel.Min() = EditPaM( pPrevNode, pPrevNode->Len() );
137
		aSel.Max() = EditPaM( pCurNode, 0 );
137
		aSel.Max() = EditPaM( pCurNode, 0 );
138
		aCurSel.Max() = pImpEditEngine->ImpDeleteSelection( aSel );
138
		aCurSel.Max() = pImpEditEngine->ImpDeleteSelection( aSel );
139
		//#115580# added at 2011/11/28 start
140
		sal_uInt16 nStart2 = pImpEditEngine->GetEditDoc().GetPos( aStart2PaM.GetNode() );
141
		sal_uInt16 nEnd2 = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
142
		for ( sal_uInt16 n = nStart2; n <= nEnd2; n++ )
143
		{
144
			ContentNode* pTmpNode = pImpEditEngine->GetEditDoc().SaveGetObject( n );
145
			if ( pTmpNode )
146
			{
147
				{//if ContentAttribs of node has no font info, add default font attribs into it.
148
					Size aSz( 12, 0 );
149
					MapMode aPntMode( MAP_POINT );
150
					MapMode _aEditMapMode( pImpEditEngine->GetRefDevice()->GetMapMode().GetMapUnit() );
151
					aSz = pImpEditEngine->GetRefDevice()->LogicToLogic( aSz, &aPntMode, &_aEditMapMode );
152
153
					SfxItemSet& rSet = pTmpNode->GetContentAttribs().GetItems();
154
					SvxFont& rFont = pTmpNode->GetCharAttribs().GetDefFont();
155
					SvxFont& rFontCJK = pTmpNode->GetCharAttribs().GetDefFontCJK();
156
					SvxFont& rFontCTL = pTmpNode->GetCharAttribs().GetDefFontCTL();
157
158
					if ( rSet.GetItemState( EE_CHAR_FONTINFO ) != SFX_ITEM_ON )
159
						rSet.Put( SvxFontItem( rFont.GetFamily(), rFont.GetName(), XubString(), 
160
									rFont.GetPitch(), rFont.GetCharSet(), EE_CHAR_FONTINFO ) );
161
					if ( rSet.GetItemState( EE_CHAR_FONTINFO_CJK ) != SFX_ITEM_ON )
162
						rSet.Put( SvxFontItem( rFontCJK.GetFamily(), rFontCJK.GetName(), XubString(), 
163
									rFontCJK.GetPitch(), rFontCJK.GetCharSet(), EE_CHAR_FONTINFO_CJK ) );
164
					if ( rSet.GetItemState( EE_CHAR_FONTINFO_CTL ) != SFX_ITEM_ON )
165
						rSet.Put( SvxFontItem( rFontCTL.GetFamily(), rFontCTL.GetName(), XubString(), 
166
									rFontCTL.GetPitch(), rFontCTL.GetCharSet(), EE_CHAR_FONTINFO_CTL ) );
167
168
					if ( rSet.GetItemState( EE_CHAR_FONTHEIGHT ) != SFX_ITEM_ON )
169
						rSet.Put( SvxFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT )  );
170
					if ( rSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) != SFX_ITEM_ON )
171
						rSet.Put( SvxFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT_CJK )  );
172
					if ( rSet.GetItemState( EE_CHAR_FONTHEIGHT_CTL ) != SFX_ITEM_ON )
173
						rSet.Put( SvxFontHeightItem( aSz.Width(), 100, EE_CHAR_FONTHEIGHT_CTL )  );
174
				}
175
176
				pImpEditEngine->AdjustParaAttribsByStyleSheet( pTmpNode );
177
				pImpEditEngine->ParaAttribsToCharAttribs( pTmpNode );
178
			}
179
		}
139
	}
180
	}
140
	EditPaM aEnd2PaM( aCurSel.Max() );
181
	EditPaM aEnd2PaM( aCurSel.Max() );
141
    //AddRTFDefaultValues( aStart2PaM, aEnd2PaM );
182
    //AddRTFDefaultValues( aStart2PaM, aEnd2PaM );
Lines 145-158 Link Here
145
	// => Zeichenattribute machen.
186
	// => Zeichenattribute machen.
146
187
147
	sal_Bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True;
188
	sal_Bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True;
148
	if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() )
189
	/* if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() ) //#115580# 
149
		pImpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() );
190
		pImpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() ); */
191
	// end
150
	aCurSel.Min() = pImpEditEngine->ImpConnectParagraphs(
192
	aCurSel.Min() = pImpEditEngine->ImpConnectParagraphs(
151
		aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward );
193
		aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward );
152
	bSpecialBackward = aEnd1PaM.GetNode()->Len() ? sal_True : sal_False;
194
	bSpecialBackward = aEnd1PaM.GetNode()->Len() ? sal_True : sal_False;
153
	// wenn bOnlyOnePara, dann ist der Node beim Connect verschwunden.
195
	// wenn bOnlyOnePara, dann ist der Node beim Connect verschwunden.
154
	if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() )
196
	/* if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() )	//#115580# 
155
		pImpEditEngine->ParaAttribsToCharAttribs( aEnd2PaM.GetNode() );
197
		pImpEditEngine->ParaAttribsToCharAttribs( aEnd2PaM.GetNode() ); */
198
	// end
156
	aCurSel.Max() = pImpEditEngine->ImpConnectParagraphs(
199
	aCurSel.Max() = pImpEditEngine->ImpConnectParagraphs(
157
		( bOnlyOnePara ? aStart1PaM.GetNode() : aEnd2PaM.GetNode() ),
200
		( bOnlyOnePara ? aStart1PaM.GetNode() : aEnd2PaM.GetNode() ),
158
			aEnd1PaM.GetNode(), bSpecialBackward );
201
			aEnd1PaM.GetNode(), bSpecialBackward );
(-)editeng/source/editeng/editdoc.hxx (-2 / +6 lines)
Lines 202-208 Link Here
202
{
202
{
203
private:
203
private:
204
	CharAttribArray	aAttribs;
204
	CharAttribArray	aAttribs;
205
	SvxFont			aDefFont;				// schneller, als jedesmal vom Pool!
205
	SvxFont			aDefFont;			// schneller, als jedesmal vom Pool!
206
	SvxFont			aDefFontCJK;			//#115580#
207
	SvxFont			aDefFontCTL;
206
	sal_Bool			bHasEmptyAttribs;
208
	sal_Bool			bHasEmptyAttribs;
207
209
208
					CharAttribList( const CharAttribList& ) {;}
210
					CharAttribList( const CharAttribList& ) {;}
Lines 228-233 Link Here
228
	void			InsertAttrib( EditCharAttrib* pAttrib );
230
	void			InsertAttrib( EditCharAttrib* pAttrib );
229
231
230
	SvxFont&		GetDefFont() 			{ return aDefFont; }
232
	SvxFont&		GetDefFont() 			{ return aDefFont; }
233
	SvxFont&		GetDefFontCJK() 		{ return aDefFontCJK; } //#115580#
234
	SvxFont&		GetDefFontCTL() 		{ return aDefFontCTL; }
231
235
232
	sal_Bool			HasEmptyAttribs() const	{ return bHasEmptyAttribs; }
236
	sal_Bool			HasEmptyAttribs() const	{ return bHasEmptyAttribs; }
233
	sal_Bool&			HasEmptyAttribs() 		{ return bHasEmptyAttribs; }
237
	sal_Bool&			HasEmptyAttribs() 		{ return bHasEmptyAttribs; }
Lines 451-457 Link Here
451
	sal_uInt16 			nEndPortion;
455
	sal_uInt16 			nEndPortion;
452
	sal_uInt16			nHeight;	// Gesamthoehe der Zeile
456
	sal_uInt16			nHeight;	// Gesamthoehe der Zeile
453
	sal_uInt16			nTxtHeight;	// Reine Texthoehe
457
	sal_uInt16			nTxtHeight;	// Reine Texthoehe
454
	sal_uInt16			nCrsrHeight;	// Bei Konturfluss hohe Zeilen => Cursor zu gro�.
458
	sal_uInt16			nCrsrHeight;	// Bei Konturfluss hohe Zeilen => Cursor zu groï¿?
455
	sal_uInt16			nMaxAscent;
459
	sal_uInt16			nMaxAscent;
456
	sal_Bool			bHangingPunctuation;
460
	sal_Bool			bHangingPunctuation;
457
	sal_Bool			bInvalid;	// fuer geschickte Formatierung
461
	sal_Bool			bInvalid;	// fuer geschickte Formatierung
(-)editeng/source/editeng/editdoc.cxx (-5 / +23 lines)
Lines 1066-1077 Link Here
1066
{
1066
{
1067
	// Erst alle Informationen aus dem Style verwenden...
1067
	// Erst alle Informationen aus dem Style verwenden...
1068
	SfxStyleSheet* pS = aContentAttribs.GetStyleSheet();
1068
	SfxStyleSheet* pS = aContentAttribs.GetStyleSheet();
1069
	if ( pS )
1069
	/* if ( pS ) //#115580#
1070
		CreateFont( GetCharAttribs().GetDefFont(), pS->GetItemSet() );
1070
	CreateFont( GetCharAttribs().GetDefFont(), pS->GetItemSet() );
1071
	
1071
1072
	// ... dann die harte Absatzformatierung rueberbuegeln...
1072
	// ... dann die harte Absatzformatierung rueberbuegeln...
1073
	CreateFont( GetCharAttribs().GetDefFont(),
1073
	CreateFont( GetCharAttribs().GetDefFont(),
1074
		GetContentAttribs().GetItems(), pS == NULL );
1074
		GetContentAttribs().GetItems(), pS == NULL ); */
1075
1076
	SvxFont& rFont = GetCharAttribs().GetDefFont();
1077
	SvxFont& rFontCJK = GetCharAttribs().GetDefFontCJK();
1078
	SvxFont& rFontCTL = GetCharAttribs().GetDefFontCTL();
1079
1080
	if ( pS )
1081
	{
1082
		CreateFont( rFont, pS->GetItemSet(), sal_True, i18n::ScriptType::LATIN );
1083
		CreateFont( rFontCJK, pS->GetItemSet(), sal_True, i18n::ScriptType::ASIAN );
1084
		CreateFont( rFontCTL, pS->GetItemSet(), sal_True, i18n::ScriptType::COMPLEX );
1085
	}
1086
1087
	CreateFont( rFont, GetContentAttribs().GetItems(), pS == NULL, i18n::ScriptType::LATIN );
1088
	CreateFont( rFontCJK, GetContentAttribs().GetItems(), pS == NULL, i18n::ScriptType::ASIAN );
1089
	CreateFont( rFontCTL, GetContentAttribs().GetItems(), pS == NULL, i18n::ScriptType::COMPLEX );
1075
}
1090
}
1076
1091
1077
void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle )
1092
void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle )
Lines 1448-1454 Link Here
1448
	{
1463
	{
1449
		ContentNode* pNode = GetObject( nNode );
1464
		ContentNode* pNode = GetObject( nNode );
1450
		nLen += pNode->Len();
1465
		nLen += pNode->Len();
1451
		// Felder k�nnen laenger sein als der Platzhalter im Node.
1466
		// Felder k???nnen laenger sein als der Platzhalter im Node.
1452
		const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs();
1467
		const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs();
1453
		for ( sal_uInt16 nAttr = rAttrs.Count(); nAttr; )
1468
		for ( sal_uInt16 nAttr = rAttrs.Count(); nAttr; )
1454
		{
1469
		{
Lines 1560-1565 Link Here
1560
1575
1561
	// Den Default-Font kopieren
1576
	// Den Default-Font kopieren
1562
	pNode->GetCharAttribs().GetDefFont() = aPaM.GetNode()->GetCharAttribs().GetDefFont();
1577
	pNode->GetCharAttribs().GetDefFont() = aPaM.GetNode()->GetCharAttribs().GetDefFont();
1578
	//#115580# start
1579
	pNode->GetCharAttribs().GetDefFontCJK() = aPaM.GetNode()->GetCharAttribs().GetDefFontCJK();
1580
	pNode->GetCharAttribs().GetDefFontCTL() = aPaM.GetNode()->GetCharAttribs().GetDefFontCTL();
1563
	SfxStyleSheet* pStyle = aPaM.GetNode()->GetStyleSheet();
1581
	SfxStyleSheet* pStyle = aPaM.GetNode()->GetStyleSheet();
1564
	if ( pStyle )
1582
	if ( pStyle )
1565
	{
1583
	{
(-)editeng/source/editeng/impedit2.cxx (+3 lines)
Lines 133-138 Link Here
133
	bOwnerOfRefDev 		= sal_False;
133
	bOwnerOfRefDev 		= sal_False;
134
	bDowning 			= sal_False;
134
	bDowning 			= sal_False;
135
	bIsInUndo 			= sal_False;
135
	bIsInUndo 			= sal_False;
136
	bIsPasting 			= sal_False; //#115580#	
136
	bIsFormatting 		= sal_False;
137
	bIsFormatting 		= sal_False;
137
	bFormatted			= sal_False;
138
	bFormatted			= sal_False;
138
	bUpdate 			= sal_True;
139
	bUpdate 			= sal_True;
Lines 3701-3706 Link Here
3701
3702
3702
	if ( rxDataObj.is() )
3703
	if ( rxDataObj.is() )
3703
	{
3704
	{
3705
		bIsPasting = sal_True; //#115580#		
3704
		datatransfer::DataFlavor aFlavor;
3706
		datatransfer::DataFlavor aFlavor;
3705
		sal_Bool bDone = sal_False;
3707
		sal_Bool bDone = sal_False;
3706
3708
Lines 3791-3796 Link Here
3791
				}
3793
				}
3792
			}
3794
			}
3793
		}
3795
		}
3796
		bIsPasting = sal_False; //#115580#		
3794
	}
3797
	}
3795
3798
3796
	return aNewSelection;
3799
	return aNewSelection;
(-)sw/source/ui/app/docshini.cxx (+139 lines)
Lines 358-363 Link Here
358
	return bRet;
358
	return bRet;
359
}
359
}
360
360
361
//#115580# When creating a new document, if needed, set the default
362
// font and languague attributes.
363
void SwDocShell::InitDefaultFontAttr( SwDoc* pDoc )
364
{
365
	sal_uInt16 aFontWhich[] =
366
	{   
367
		RES_CHRATR_FONT,
368
		RES_CHRATR_CJK_FONT,
369
		RES_CHRATR_CTL_FONT
370
	};
371
	sal_uInt16 aFontHeightWhich[] =
372
	{
373
		RES_CHRATR_FONTSIZE,
374
		RES_CHRATR_CJK_FONTSIZE,
375
		RES_CHRATR_CTL_FONTSIZE
376
	};
377
	sal_uInt16 aFontIds[] =
378
	{
379
		FONT_STANDARD,
380
		FONT_STANDARD_CJK,
381
		FONT_STANDARD_CTL
382
	};
383
	sal_uInt16 nFontTypes[] =
384
	{
385
		DEFAULTFONT_LATIN_TEXT,
386
		DEFAULTFONT_CJK_TEXT,
387
		DEFAULTFONT_CTL_TEXT
388
	};
389
390
	sal_uInt16 aLangWhich[] =
391
	{
392
		RES_CHRATR_LANGUAGE,
393
		RES_CHRATR_CJK_LANGUAGE,
394
		RES_CHRATR_CTL_LANGUAGE
395
	};
396
	sal_uInt16 aLangTypes[] =
397
	{
398
		LANGUAGE_ENGLISH_US,
399
		LANGUAGE_ENGLISH_US,
400
		LANGUAGE_ARABIC_SAUDI_ARABIA
401
	};
402
403
	SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
404
	SfxPrinter* pPrt = pDoc->getPrinter( false );
405
	String sEntry;
406
407
	for(sal_uInt8 i = 0; i < 3; i++)
408
	{
409
		sal_uInt16 nFontWhich = aFontWhich[i];
410
		sal_uInt16 nFontId = aFontIds[i];
411
		SvxFontItem* pFontItem = 0;
412
		const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangWhich[i] );
413
		LanguageType eLanguage = rLang.GetLanguage();
414
		if ( (eLanguage == LANGUAGE_DONTKNOW) || (eLanguage == LANGUAGE_NONE) )
415
			eLanguage = aLangTypes[i];
416
		{
417
			if ( i == 0 )
418
			{//At present, just supports for the following languages: english, french and german.
419
				LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
420
				switch( eUiLanguage )
421
				{
422
				case LANGUAGE_ENGLISH_US:
423
				case LANGUAGE_FRENCH:
424
				case LANGUAGE_FRENCH_BELGIAN:
425
				case LANGUAGE_FRENCH_CAMEROON:
426
				case LANGUAGE_FRENCH_CANADIAN:
427
				case LANGUAGE_FRENCH_COTE_D_IVOIRE:
428
				case LANGUAGE_FRENCH_HAITI:
429
				case LANGUAGE_FRENCH_LUXEMBOURG:
430
				case LANGUAGE_FRENCH_MALI:
431
				case LANGUAGE_FRENCH_MONACO:
432
				case LANGUAGE_FRENCH_MOROCCO:
433
				case LANGUAGE_FRENCH_NORTH_AFRICA:
434
				case LANGUAGE_FRENCH_REUNION:
435
				case LANGUAGE_FRENCH_SENEGAL:
436
				case LANGUAGE_FRENCH_SWISS:
437
				case LANGUAGE_FRENCH_WEST_INDIES:
438
				case LANGUAGE_FRENCH_ZAIRE:
439
				case LANGUAGE_GERMAN:
440
				case LANGUAGE_GERMAN_AUSTRIAN:
441
				case LANGUAGE_GERMAN_LIECHTENSTEIN:
442
				case LANGUAGE_GERMAN_LUXEMBOURG:
443
				case LANGUAGE_GERMAN_SWISS:
444
					eLanguage = eUiLanguage;
445
					break;
446
447
				}
448
			}
449
450
			if ( i == 2 ) //CTL,just supports for HINDI and ARABIC_SAUDI_ARABIA
451
			{
452
				LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
453
				switch( eUiLanguage )
454
				{
455
				case LANGUAGE_HINDI:
456
					eLanguage = eUiLanguage;
457
					break;
458
459
				}
460
			}
461
462
			if ( i == 1 ) //CJK
463
			{
464
				LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
465
				switch( eUiLanguage )
466
				{
467
				case LANGUAGE_KOREAN:
468
				case LANGUAGE_KOREAN_JOHAB:
469
				case LANGUAGE_CHINESE:
470
				case LANGUAGE_CHINESE_HONGKONG:
471
				case LANGUAGE_CHINESE_MACAU:
472
				case LANGUAGE_CHINESE_SIMPLIFIED:
473
				case LANGUAGE_CHINESE_SINGAPORE:
474
				case LANGUAGE_CHINESE_TRADITIONAL:
475
				case LANGUAGE_JAPANESE:
476
					eLanguage = eUiLanguage;
477
					break;
478
				}
479
			}
480
481
			Font aLangDefFont = OutputDevice::GetDefaultFont(
482
				nFontTypes[i],
483
				eLanguage,
484
				DEFAULTFONT_FLAGS_ONLYONE );
485
			pFontItem = new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(),
486
				aEmptyStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich);
487
		}
488
489
		pDoc->SetDefault(*pFontItem);
490
		delete pFontItem; 
491
492
		sal_Int32 nFontHeight = pStdFont->GetFontHeight( FONT_STANDARD, i, eLanguage );
493
		if(nFontHeight <= 0)
494
			nFontHeight = pStdFont->GetDefaultHeightFor( nFontId, eLanguage );
495
		pDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] ));
496
		pDoc->SetDefault( SvxLanguageItem( eLanguage, aLangWhich[i] ) );
497
	}
498
}
499
361
/*--------------------------------------------------------------------
500
/*--------------------------------------------------------------------
362
	Beschreibung:	Ctor mit SfxCreateMode ?????
501
	Beschreibung:	Ctor mit SfxCreateMode ?????
363
 --------------------------------------------------------------------*/
502
 --------------------------------------------------------------------*/
(-)sw/source/ui/dochdl/swdtflvr.cxx (+2 lines)
Lines 838-843 Link Here
838
838
839
        SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
839
        SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
840
840
841
		SwDocShell::InitDefaultFontAttr( pTmpDoc ); //#115580#
842
841
		pTmpDoc->LockExpFlds(); 	// nie die Felder updaten - Text so belassen
843
		pTmpDoc->LockExpFlds(); 	// nie die Felder updaten - Text so belassen
842
		pWrtShell->Copy( pTmpDoc );
844
		pWrtShell->Copy( pTmpDoc );
843
845
(-)sw/inc/docsh.hxx (+2 lines)
Lines 147-152 Link Here
147
147
148
	static rtl::OUString GetEventName( sal_Int32 nId );
148
	static rtl::OUString GetEventName( sal_Int32 nId );
149
149
150
	static void	InitDefaultFontAttr( SwDoc* pDoc ); //#115580# added at 2011/11/28
151
150
	//Das Doc wird fuer SO-Datenaustausch benoetigt!
152
	//Das Doc wird fuer SO-Datenaustausch benoetigt!
151
	SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED );
153
	SwDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED );
152
	SwDocShell( const sal_uInt64 i_nSfxCreationFlags );
154
	SwDocShell( const sal_uInt64 i_nSfxCreationFlags );

Return to issue 115580