ReferenceSizeProvider.cxx (cde9e8dc) | ReferenceSizeProvider.cxx (e62cf9b4) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 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 9 * with the License. You may obtain a copy of the License at | 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 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_chart2.hxx" 26 27#include "ReferenceSizeProvider.hxx" --- 107 unchanged lines hidden (view full) --- 135 (*aIt)->getDataPointByIndex( aPointIndexes[i] ) ); 136 } 137 } 138 catch( const uno::Exception & ex ) 139 { 140 ASSERT_EXCEPTION( ex ); 141 } 142 | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_chart2.hxx" 26 27#include "ReferenceSizeProvider.hxx" --- 107 unchanged lines hidden (view full) --- 135 (*aIt)->getDataPointByIndex( aPointIndexes[i] ) ); 136 } 137 } 138 catch( const uno::Exception & ex ) 139 { 140 ASSERT_EXCEPTION( ex ); 141 } 142 |
143 //it is important to correct the datapoint properties first as they do reference the series properties | 143 // it is important to correct the datapoint properties first as they do reference the series properties |
144 setValuesAtPropertySet( xSeriesProp ); 145 } 146 } 147} 148 149void ReferenceSizeProvider::setValuesAtPropertySet( 150 const Reference< beans::XPropertySet > & xProp, 151 bool bAdaptFontSizes /* = true */ ) 152{ 153 if( ! xProp.is()) 154 return; 155 156 static const OUString aRefSizeName( RTL_CONSTASCII_USTRINGPARAM("ReferencePageSize")); | 144 setValuesAtPropertySet( xSeriesProp ); 145 } 146 } 147} 148 149void ReferenceSizeProvider::setValuesAtPropertySet( 150 const Reference< beans::XPropertySet > & xProp, 151 bool bAdaptFontSizes /* = true */ ) 152{ 153 if( ! xProp.is()) 154 return; 155 156 static const OUString aRefSizeName( RTL_CONSTASCII_USTRINGPARAM("ReferencePageSize")); |
157 | 157 |
158 try 159 { 160 awt::Size aRefSize( getPageSize() ); 161 awt::Size aOldRefSize; 162 bool bHasOldRefSize( xProp->getPropertyValue( aRefSizeName ) >>= aOldRefSize ); 163 164 if( useAutoScale()) 165 { --- 35 unchanged lines hidden (view full) --- 201 eSingleState = AUTO_RESIZE_NO; 202 } 203 catch( uno::Exception ) 204 { 205 // unknown property -> state stays unknown 206 } 207 } 208 | 158 try 159 { 160 awt::Size aRefSize( getPageSize() ); 161 awt::Size aOldRefSize; 162 bool bHasOldRefSize( xProp->getPropertyValue( aRefSizeName ) >>= aOldRefSize ); 163 164 if( useAutoScale()) 165 { --- 35 unchanged lines hidden (view full) --- 201 eSingleState = AUTO_RESIZE_NO; 202 } 203 catch( uno::Exception ) 204 { 205 // unknown property -> state stays unknown 206 } 207 } 208 |
209 // curent state unknown => nothing changes. Otherwise if current state | 209 // current state unknown => nothing changes. Otherwise if current state |
210 // differs from state so far, we have an ambiguity 211 if( rInOutState == AUTO_RESIZE_UNKNOWN ) 212 { 213 rInOutState = eSingleState; 214 } 215 else if( eSingleState != AUTO_RESIZE_UNKNOWN && 216 eSingleState != rInOutState ) 217 { --- 9 unchanged lines hidden (view full) --- 227 { 228 Reference< beans::XPropertySet > xProp( xTitled->getTitleObject(), uno::UNO_QUERY ); 229 if( xProp.is()) 230 getAutoResizeFromPropSet( xProp, rInOutState ); 231 } 232} 233 234/** Retrieves the state auto-resize from all objects that support this | 210 // differs from state so far, we have an ambiguity 211 if( rInOutState == AUTO_RESIZE_UNKNOWN ) 212 { 213 rInOutState = eSingleState; 214 } 215 else if( eSingleState != AUTO_RESIZE_UNKNOWN && 216 eSingleState != rInOutState ) 217 { --- 9 unchanged lines hidden (view full) --- 227 { 228 Reference< beans::XPropertySet > xProp( xTitled->getTitleObject(), uno::UNO_QUERY ); 229 if( xProp.is()) 230 getAutoResizeFromPropSet( xProp, rInOutState ); 231 } 232} 233 234/** Retrieves the state auto-resize from all objects that support this |
235 feature. If all objects return the same state, AUTO_RESIZE_YES or | 235 feature. If all objects return the same state, AUTO_RESIZE_YES or |
236 AUTO_RESIZE_NO is returned. 237 238 If no object supporting the feature is found, AUTO_RESIZE_UNKNOWN is | 236 AUTO_RESIZE_NO is returned. 237 238 If no object supporting the feature is found, AUTO_RESIZE_UNKNOWN is |
239 returned. If there are multiple objects, some with state YES and some | 239 returned. If there are multiple objects, some with state YES and some |
240 with state NO, AUTO_RESIZE_AMBIGUOUS is returned. 241*/ 242ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState( 243 const Reference< XChartDocument > & xChartDoc ) 244{ 245 AutoResizeState eResult = AUTO_RESIZE_UNKNOWN; 246 247 // Main Title --- 127 unchanged lines hidden --- | 240 with state NO, AUTO_RESIZE_AMBIGUOUS is returned. 241*/ 242ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState( 243 const Reference< XChartDocument > & xChartDoc ) 244{ 245 AutoResizeState eResult = AUTO_RESIZE_UNKNOWN; 246 247 // Main Title --- 127 unchanged lines hidden --- |