fulinend.cxx (79aad27f) | fulinend.cxx (c7be74b1) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 94 unchanged lines hidden (view full) --- 103 else return; // Abbruch 104 } 105 106 const ::basegfx::B2DPolyPolygon aPolyPolygon = ( (SdrPathObj*) pNewObj )->GetPathPoly(); 107 108 // Loeschen des angelegten PolyObjektes 109 SdrObject::Free( pConvPolyObj ); 110 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 94 unchanged lines hidden (view full) --- 103 else return; // Abbruch 104 } 105 106 const ::basegfx::B2DPolyPolygon aPolyPolygon = ( (SdrPathObj*) pNewObj )->GetPathPoly(); 107 108 // Loeschen des angelegten PolyObjektes 109 SdrObject::Free( pConvPolyObj ); 110 |
111 XLineEndList* pLineEndList = mpDoc->GetLineEndList(); 112 XLineEndEntry* pEntry; 113 | |
114 String aNewName( SdResId( STR_LINEEND ) ); 115 String aDesc( SdResId( STR_DESC_LINEEND ) ); 116 String aName; 117 | 111 String aNewName( SdResId( STR_LINEEND ) ); 112 String aDesc( SdResId( STR_DESC_LINEEND ) ); 113 String aName; 114 |
118 long nCount = pLineEndList->Count(); | 115 XLineEndListSharedPtr aLineEndList = mpDoc->GetLineEndListFromSdrModel(); 116 long nCount = aLineEndList.get() ? aLineEndList->Count() : 0; |
119 long j = 1; 120 sal_Bool bDifferent = sal_False; 121 122 while( !bDifferent ) 123 { 124 aName = aNewName; 125 aName.Append( sal_Unicode(' ') ); 126 aName.Append( UniString::CreateFromInt32( j++ ) ); 127 bDifferent = sal_True; 128 for( long i = 0; i < nCount && bDifferent; i++ ) 129 { | 117 long j = 1; 118 sal_Bool bDifferent = sal_False; 119 120 while( !bDifferent ) 121 { 122 aName = aNewName; 123 aName.Append( sal_Unicode(' ') ); 124 aName.Append( UniString::CreateFromInt32( j++ ) ); 125 bDifferent = sal_True; 126 for( long i = 0; i < nCount && bDifferent; i++ ) 127 { |
130 if( aName == pLineEndList->GetLineEnd( i )->GetName() ) | 128 if( aName == aLineEndList->GetLineEnd( i )->GetName() ) |
131 bDifferent = sal_False; 132 } 133 } 134 135 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 136 AbstractSvxNameDialog* pDlg = pFact ? pFact->CreateSvxNameDialog( NULL, aName, aDesc ) : 0; 137 138 if( pDlg ) 139 { 140 pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_LINEEND ); 141 142 if( pDlg->Execute() == RET_OK ) 143 { 144 pDlg->GetName( aName ); 145 bDifferent = sal_True; 146 147 for( long i = 0; i < nCount && bDifferent; i++ ) 148 { | 129 bDifferent = sal_False; 130 } 131 } 132 133 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 134 AbstractSvxNameDialog* pDlg = pFact ? pFact->CreateSvxNameDialog( NULL, aName, aDesc ) : 0; 135 136 if( pDlg ) 137 { 138 pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_LINEEND ); 139 140 if( pDlg->Execute() == RET_OK ) 141 { 142 pDlg->GetName( aName ); 143 bDifferent = sal_True; 144 145 for( long i = 0; i < nCount && bDifferent; i++ ) 146 { |
149 if( aName == pLineEndList->GetLineEnd( i )->GetName() ) | 147 if( aName == aLineEndList->GetLineEnd( i )->GetName() ) |
150 bDifferent = sal_False; 151 } 152 153 if( bDifferent ) 154 { | 148 bDifferent = sal_False; 149 } 150 151 if( bDifferent ) 152 { |
155 pEntry = new XLineEndEntry( aPolyPolygon, aName ); 156 pLineEndList->Insert( pEntry, LIST_APPEND); | 153 XLineEndEntry* pEntry = new XLineEndEntry( aPolyPolygon, aName ); 154 aLineEndList->Insert( pEntry, LIST_APPEND); |
157 } 158 else 159 { 160 String aStr(SdResId( STR_WARN_NAME_DUPLICATE )); 161 WarningBox aWarningBox( mpWindow, WinBits( WB_OK ), 162 aStr ); 163 aWarningBox.Execute(); 164 } --- 15 unchanged lines hidden --- | 155 } 156 else 157 { 158 String aStr(SdResId( STR_WARN_NAME_DUPLICATE )); 159 WarningBox aWarningBox( mpWindow, WinBits( WB_OK ), 160 aStr ); 161 aWarningBox.Execute(); 162 } --- 15 unchanged lines hidden --- |