weighhdl.cxx (63bba73c) | weighhdl.cxx (1776ad39) |
---|---|
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 --- 89 unchanged lines hidden (view full) --- 98 if( bRet ) 99 nWeight = sal::static_int_cast< sal_uInt16 >(nTemp); 100 } 101 102 if( bRet ) 103 { 104 bRet = sal_False; 105 static int nCount = sizeof(aFontWeightMap)/sizeof(FontWeightMapper); | 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 --- 89 unchanged lines hidden (view full) --- 98 if( bRet ) 99 nWeight = sal::static_int_cast< sal_uInt16 >(nTemp); 100 } 101 102 if( bRet ) 103 { 104 bRet = sal_False; 105 static int nCount = sizeof(aFontWeightMap)/sizeof(FontWeightMapper); |
106 for( int i=0; i<nCount; i++ ) | 106 for (int i = 0; i < (nCount-1); ++i) |
107 { 108 if( (nWeight >= aFontWeightMap[i].nValue) && (nWeight <= aFontWeightMap[i+1].nValue) ) 109 { 110 sal_uInt16 nDiff1 = nWeight - aFontWeightMap[i].nValue; 111 sal_uInt16 nDiff2 = aFontWeightMap[i+1].nValue - nWeight; 112 113 if( nDiff1 < nDiff2 ) 114 rValue <<= aFontWeightMap[i].fWeight; --- 57 unchanged lines hidden --- | 107 { 108 if( (nWeight >= aFontWeightMap[i].nValue) && (nWeight <= aFontWeightMap[i+1].nValue) ) 109 { 110 sal_uInt16 nDiff1 = nWeight - aFontWeightMap[i].nValue; 111 sal_uInt16 nDiff2 = aFontWeightMap[i+1].nValue - nWeight; 112 113 if( nDiff1 < nDiff2 ) 114 rValue <<= aFontWeightMap[i].fWeight; --- 57 unchanged lines hidden --- |