richtextimplcontrol.cxx (24acc546) richtextimplcontrol.cxx (07a3d7f1)
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

--- 53 unchanged lines hidden (view full) ---

62 ,m_pScrollCorner ( NULL )
63 ,m_pEngine ( _pEngine )
64 ,m_pView ( NULL )
65 ,m_pTextAttrListener ( _pTextAttrListener )
66 ,m_pSelectionListener ( _pSelectionListener )
67 ,m_bHasEverBeenShown ( false )
68 {
69 OSL_ENSURE( m_pAntiImpl, "RichTextControlImpl::RichTextControlImpl: invalid window!" );
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

--- 53 unchanged lines hidden (view full) ---

62 ,m_pScrollCorner ( NULL )
63 ,m_pEngine ( _pEngine )
64 ,m_pView ( NULL )
65 ,m_pTextAttrListener ( _pTextAttrListener )
66 ,m_pSelectionListener ( _pSelectionListener )
67 ,m_bHasEverBeenShown ( false )
68 {
69 OSL_ENSURE( m_pAntiImpl, "RichTextControlImpl::RichTextControlImpl: invalid window!" );
70 OSL_ENSURE( m_pEngine, "RichTextControlImpl::RichTextControlImpl: invalid edit engine! This will *definately* crash!" );
70 OSL_ENSURE( m_pEngine, "RichTextControlImpl::RichTextControlImpl: invalid edit engine! This will *definitely* crash!" );
71
72 m_pViewport = new RichTextViewPort( m_pAntiImpl );
73 m_pViewport->setAttributeInvalidationHandler( LINK( this, RichTextControlImpl, OnInvalidateAllAttributes ) );
74 m_pViewport->Show();
75
76 // ensure that both the window and the reference device have the same map unit
77 MapMode aRefDeviceMapMode( m_pEngine->GetRefDevice()->GetMapMode() );
78 m_pAntiImpl->SetMapMode( aRefDeviceMapMode );

--- 40 unchanged lines hidden (view full) ---

119 || ( _pHandler->first == SID_ATTR_CHAR_FONTHEIGHT )
120 )
121 {
122 // these are attributes whose value depends on the current script type.
123 // I.e., in real, there are *three* items in the ItemSet: One for each script
124 // type (Latin, Asian, Complex). However, if we have an observer who is interested
125 // in the state of this attribute, we have to kind of *merge* the three attributes
126 // to only one.
71
72 m_pViewport = new RichTextViewPort( m_pAntiImpl );
73 m_pViewport->setAttributeInvalidationHandler( LINK( this, RichTextControlImpl, OnInvalidateAllAttributes ) );
74 m_pViewport->Show();
75
76 // ensure that both the window and the reference device have the same map unit
77 MapMode aRefDeviceMapMode( m_pEngine->GetRefDevice()->GetMapMode() );
78 m_pAntiImpl->SetMapMode( aRefDeviceMapMode );

--- 40 unchanged lines hidden (view full) ---

119 || ( _pHandler->first == SID_ATTR_CHAR_FONTHEIGHT )
120 )
121 {
122 // these are attributes whose value depends on the current script type.
123 // I.e., in real, there are *three* items in the ItemSet: One for each script
124 // type (Latin, Asian, Complex). However, if we have an observer who is interested
125 // in the state of this attribute, we have to kind of *merge* the three attributes
126 // to only one.
127 // This is usefull in case the observer is for instance a toolbox which contains only
127 // This is useful in case the observer is for instance a toolbox which contains only
128 // an, e.g., "bold" slot, and thus not interested in the particular script type of the
129 // current selection.
130 SvxScriptSetItem aNormalizedSet( (WhichId)_pHandler->first, *m_pView->GetAttribs().GetPool() );
131 normalizeScriptDependentAttribute( aNormalizedSet );
132
133 implCheckUpdateCache( _pHandler->first, _pHandler->second->getState( aNormalizedSet.GetItemSet() ) );
134 }
135 else

--- 166 unchanged lines hidden (view full) ---

302 bool bVScroll = 0 != ( nStatusWord & EE_STAT_VSCROLL );
303
304 // In case of *no* automatic line breaks, we also need to check for the *range* here.
305 // Normally, we would do this only after a EE_STAT_TEXTWIDTHCHANGED. However, due to a bug
306 // in the EditEngine (I believe so) this is not fired when the engine does not have
307 // the AutoPaperSize bits set.
308 // So in order to be properly notified, we would need the AutoPaperSize. But, with
309 // AutoPaperSize, other things do not work anymore: Either, when we set a MaxAutoPaperSize,
128 // an, e.g., "bold" slot, and thus not interested in the particular script type of the
129 // current selection.
130 SvxScriptSetItem aNormalizedSet( (WhichId)_pHandler->first, *m_pView->GetAttribs().GetPool() );
131 normalizeScriptDependentAttribute( aNormalizedSet );
132
133 implCheckUpdateCache( _pHandler->first, _pHandler->second->getState( aNormalizedSet.GetItemSet() ) );
134 }
135 else

--- 166 unchanged lines hidden (view full) ---

302 bool bVScroll = 0 != ( nStatusWord & EE_STAT_VSCROLL );
303
304 // In case of *no* automatic line breaks, we also need to check for the *range* here.
305 // Normally, we would do this only after a EE_STAT_TEXTWIDTHCHANGED. However, due to a bug
306 // in the EditEngine (I believe so) this is not fired when the engine does not have
307 // the AutoPaperSize bits set.
308 // So in order to be properly notified, we would need the AutoPaperSize. But, with
309 // AutoPaperSize, other things do not work anymore: Either, when we set a MaxAutoPaperSize,
310 // then the view does automatic soft line breaks at the paper end - which we definately do
310 // then the view does automatic soft line breaks at the paper end - which we definitely do
311 // want. Or, if we did not set a MaxAutoPaperSize, then the view does not automatically scroll
312 // anymore in horizontal direction.
313 // So this is some kind of lose-lose situation ... :(
314 if ( !windowHasAutomaticLineBreak() && bHScroll )
315 {
316 updateScrollbars();
317 return;
318 }

--- 358 unchanged lines hidden ---
311 // want. Or, if we did not set a MaxAutoPaperSize, then the view does not automatically scroll
312 // anymore in horizontal direction.
313 // So this is some kind of lose-lose situation ... :(
314 if ( !windowHasAutomaticLineBreak() && bHScroll )
315 {
316 updateScrollbars();
317 return;
318 }

--- 358 unchanged lines hidden ---