tablecontrol_impl.cxx (d5c88d43) | tablecontrol_impl.cxx (de739a45) |
---|---|
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 --- 1078 unchanged lines hidden (view full) --- 1087 // yes => ignore relative flexibilities, and subsequently distribute single pixels to all flexible 1088 // columns which did not yet reach their maximum. 1089 for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( distributePixel > 0 ); ++i ) 1090 { 1091 if ( columnFlexibilities[i] == 0 ) 1092 continue; 1093 1094 OSL_ENSURE( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].second, | 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 --- 1078 unchanged lines hidden (view full) --- 1087 // yes => ignore relative flexibilities, and subsequently distribute single pixels to all flexible 1088 // columns which did not yet reach their maximum. 1089 for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( distributePixel > 0 ); ++i ) 1090 { 1091 if ( columnFlexibilities[i] == 0 ) 1092 continue; 1093 1094 OSL_ENSURE( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].second, |
1095 "TableControl_Impl::impl_ni_calculateColumnWidths: inconsitency!" ); | 1095 "TableControl_Impl::impl_ni_calculateColumnWidths: inconsistency!" ); |
1096 if ( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first ) 1097 { 1098 columnFlexibilities[i] = 0; 1099 --flexibleColumnCount; 1100 continue; 1101 } 1102 1103 ++o_newColWidthsPixel[i]; --- 58 unchanged lines hidden (view full) --- 1162 // yes => ignore relative flexibilities, and subsequently take away pixels from all flexible 1163 // columns which did not yet reach their minimum. 1164 for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( takeAwayPixel > 0 ); ++i ) 1165 { 1166 if ( columnFlexibilities[i] == 0 ) 1167 continue; 1168 1169 OSL_ENSURE( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first, | 1096 if ( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first ) 1097 { 1098 columnFlexibilities[i] = 0; 1099 --flexibleColumnCount; 1100 continue; 1101 } 1102 1103 ++o_newColWidthsPixel[i]; --- 58 unchanged lines hidden (view full) --- 1162 // yes => ignore relative flexibilities, and subsequently take away pixels from all flexible 1163 // columns which did not yet reach their minimum. 1164 for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( takeAwayPixel > 0 ); ++i ) 1165 { 1166 if ( columnFlexibilities[i] == 0 ) 1167 continue; 1168 1169 OSL_ENSURE( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first, |
1170 "TableControl_Impl::impl_ni_calculateColumnWidths: inconsitency!" ); | 1170 "TableControl_Impl::impl_ni_calculateColumnWidths: inconsistency!" ); |
1171 if ( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].first ) 1172 { 1173 columnFlexibilities[i] = 0; 1174 --flexibleColumnCount; 1175 continue; 1176 } 1177 1178 --o_newColWidthsPixel[i]; --- 1177 unchanged lines hidden (view full) --- 2356 m_pDataWindow->GetParent()->Invalidate( INVALIDATE_TRANSPARENT ); 2357 } 2358 2359 // update the position at the vertical scrollbar 2360 if ( m_pVScroll != NULL ) 2361 m_pVScroll->SetThumbPos( m_nTopRow ); 2362 } 2363 | 1171 if ( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].first ) 1172 { 1173 columnFlexibilities[i] = 0; 1174 --flexibleColumnCount; 1175 continue; 1176 } 1177 1178 --o_newColWidthsPixel[i]; --- 1177 unchanged lines hidden (view full) --- 2356 m_pDataWindow->GetParent()->Invalidate( INVALIDATE_TRANSPARENT ); 2357 } 2358 2359 // update the position at the vertical scrollbar 2360 if ( m_pVScroll != NULL ) 2361 m_pVScroll->SetThumbPos( m_nTopRow ); 2362 } 2363 |
2364 // The scroll bar availaility might change when we scrolled. | 2364 // The scroll bar availability might change when we scrolled. |
2365 // For instance, imagine a view with 10 rows, if which 5 fit into the window, numbered 1 to 10. 2366 // Now let 2367 // - the user scroll to row number 6, so the last 5 rows are visible 2368 // - somebody remove the last 4 rows 2369 // - the user scroll to row number 5 being the top row, so the last two rows are visible 2370 // - somebody remove row number 6 2371 // - the user scroll to row number 1 2372 // => in this case, the need for the scrollbar vanishes immediately. --- 63 unchanged lines hidden (view full) --- 2436 m_pDataWindow->GetParent()->Invalidate( INVALIDATE_TRANSPARENT ); 2437 } 2438 2439 // update the position at the horizontal scrollbar 2440 if ( m_pHScroll != NULL ) 2441 m_pHScroll->SetThumbPos( m_nLeftColumn ); 2442 } 2443 | 2365 // For instance, imagine a view with 10 rows, if which 5 fit into the window, numbered 1 to 10. 2366 // Now let 2367 // - the user scroll to row number 6, so the last 5 rows are visible 2368 // - somebody remove the last 4 rows 2369 // - the user scroll to row number 5 being the top row, so the last two rows are visible 2370 // - somebody remove row number 6 2371 // - the user scroll to row number 1 2372 // => in this case, the need for the scrollbar vanishes immediately. --- 63 unchanged lines hidden (view full) --- 2436 m_pDataWindow->GetParent()->Invalidate( INVALIDATE_TRANSPARENT ); 2437 } 2438 2439 // update the position at the horizontal scrollbar 2440 if ( m_pHScroll != NULL ) 2441 m_pHScroll->SetThumbPos( m_nLeftColumn ); 2442 } 2443 |
2444 // The scroll bar availaility might change when we scrolled. This is because we do not hide | 2444 // The scroll bar availability might change when we scrolled. This is because we do not hide |
2445 // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will 2446 // be auto-hidden when it's scrolled back to pos 0. 2447 if ( m_nLeftColumn == 0 ) 2448 m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) ); 2449 2450 return (TableSize)( m_nLeftColumn - nOldLeftColumn ); 2451 } 2452 --- 451 unchanged lines hidden --- | 2445 // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will 2446 // be auto-hidden when it's scrolled back to pos 0. 2447 if ( m_nLeftColumn == 0 ) 2448 m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) ); 2449 2450 return (TableSize)( m_nLeftColumn - nOldLeftColumn ); 2451 } 2452 --- 451 unchanged lines hidden --- |