LibreOffice Module sw (master)  1
srcedtw.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <hintids.hxx>
23 #include <cmdid.h>
24 
25 #include <com/sun/star/beans/XMultiPropertySet.hpp>
26 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <officecfg/Office/Common.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/log.hxx>
31 #include <vcl/commandevent.hxx>
32 #include <vcl/event.hxx>
33 #include <vcl/svapp.hxx>
34 #include <vcl/textview.hxx>
35 #include <svx/svxids.hrc>
36 #include <vcl/scrbar.hxx>
37 #include <vcl/ptrstyle.hxx>
38 #include <sfx2/dispatch.hxx>
39 #include <sfx2/app.hxx>
40 #include <sfx2/viewfrm.hxx>
41 #include <svtools/htmltokn.h>
42 #include <vcl/txtattr.hxx>
43 #include <vcl/settings.hxx>
44 #include <svtools/colorcfg.hxx>
45 #include <editeng/flstitem.hxx>
46 #include <vcl/metric.hxx>
47 #include <svtools/ctrltool.hxx>
48 #include <tools/time.hxx>
49 #include <swmodule.hxx>
50 #include <docsh.hxx>
51 #include <srcview.hxx>
52 #include <helpids.h>
53 #include <vector>
54 
55 namespace
56 {
57 
58 struct TextPortion
59 {
60  sal_uInt16 nStart, nEnd;
62 };
63 
64 }
65 
66 #define MAX_SYNTAX_HIGHLIGHT 20
67 #define MAX_HIGHLIGHTTIME 200
68 
69 typedef std::vector<TextPortion> TextPortions;
70 
71 static void lcl_Highlight(const OUString& rSource, TextPortions& aPortionList)
72 {
73  const sal_Unicode cOpenBracket = '<';
74  const sal_Unicode cCloseBracket= '>';
75  const sal_Unicode cSlash = '/';
76  const sal_Unicode cExclamation = '!';
77  const sal_Unicode cMinus = '-';
78  const sal_Unicode cSpace = ' ';
79  const sal_Unicode cTab = 0x09;
80  const sal_Unicode cLF = 0x0a;
81  const sal_Unicode cCR = 0x0d;
82 
83  const sal_uInt16 nStrLen = rSource.getLength();
84  sal_uInt16 nInsert = 0; // number of inserted portions
85  sal_uInt16 nActPos = 0; // position, where '<' was found
86  sal_uInt16 nPortStart = USHRT_MAX; // for the TextPortion
87  sal_uInt16 nPortEnd = 0;
88  TextPortion aText;
89  while(nActPos < nStrLen)
90  {
92  if((nActPos < nStrLen - 2) && (rSource[nActPos] == cOpenBracket))
93  {
94  // insert 'empty' portion
95  if(nPortEnd < nActPos - 1 )
96  {
97  // don't move at the beginning
98  aText.nStart = nPortEnd;
99  if(nInsert)
100  aText.nStart += 1;
101  aText.nEnd = nActPos - 1;
102  aText.eType = svtools::HTMLUNKNOWN;
103  aPortionList.push_back( aText );
104  nInsert++;
105  }
106  sal_Unicode cFollowFirst = rSource[nActPos + 1];
107  sal_Unicode cFollowNext = rSource[nActPos + 2];
108  if(cExclamation == cFollowFirst)
109  {
110  // "<!" SGML or comment
111  if(cMinus == cFollowNext &&
112  nActPos < nStrLen - 3 && cMinus == rSource[nActPos + 3])
113  {
114  eFoundType = svtools::HTMLCOMMENT;
115  }
116  else
117  eFoundType = svtools::HTMLSGML;
118  nPortStart = nActPos;
119  nPortEnd = nActPos + 1;
120  }
121  else if(cSlash == cFollowFirst)
122  {
123  // "</" ignore slash
124  nPortStart = nActPos;
125  nActPos++;
126  }
127  if(svtools::HTMLUNKNOWN == eFoundType)
128  {
129  // now here a keyword could follow
130  sal_uInt16 nSrchPos = nActPos;
131  while(++nSrchPos < nStrLen - 1)
132  {
133  sal_Unicode cNext = rSource[nSrchPos];
134  if( cNext == cSpace ||
135  cNext == cTab ||
136  cNext == cLF ||
137  cNext == cCR)
138  break;
139  else if(cNext == cCloseBracket)
140  {
141  break;
142  }
143  }
144  if(nSrchPos > nActPos + 1)
145  {
146  // some string was found
147  OUString sToken = rSource.copy(nActPos + 1, nSrchPos - nActPos - 1 );
148  sToken = sToken.toAsciiUpperCase();
149  HtmlTokenId nToken = ::GetHTMLToken(sToken);
150  if(nToken != HtmlTokenId::NONE)
151  {
152  // Token was found
153  eFoundType = svtools::HTMLKEYWORD;
154  nPortEnd = nSrchPos;
155  nPortStart = nActPos;
156  }
157  else
158  {
159  // what was that?
160  SAL_WARN(
161  "sw.level2",
162  "Token " << sToken
163  << " not recognised!");
164  }
165 
166  }
167  }
168  // now we still have to look for '>'
169  if(svtools::HTMLUNKNOWN != eFoundType)
170  {
171  bool bFound = false;
172  for(sal_uInt16 i = nPortEnd; i < nStrLen; i++)
173  if(cCloseBracket == rSource[i])
174  {
175  bFound = true;
176  nPortEnd = i;
177  break;
178  }
179  if(!bFound && (eFoundType == svtools::HTMLCOMMENT))
180  {
181  // comment without ending in this line
182  bFound = true;
183  nPortEnd = nStrLen - 1;
184  }
185 
186  if(bFound ||(eFoundType == svtools::HTMLCOMMENT))
187  {
188  TextPortion aTextPortion;
189  aTextPortion.nStart = nPortStart + 1;
190  aTextPortion.nEnd = nPortEnd;
191  aTextPortion.eType = eFoundType;
192  aPortionList.push_back( aTextPortion );
193  nInsert++;
194  }
195 
196  }
197  }
198  nActPos++;
199  }
200  if(nInsert && nPortEnd < nActPos - 1)
201  {
202  aText.nStart = nPortEnd + 1;
203  aText.nEnd = nActPos - 1;
204  aText.eType = svtools::HTMLUNKNOWN;
205  aPortionList.push_back( aText );
206  nInsert++;
207  }
208 }
209 
211  public cppu::WeakImplHelper< css::beans::XPropertiesChangeListener >
212 {
213 public:
214  explicit ChangesListener(SwSrcEditWindow & editor): editor_(editor) {}
215 
216 private:
217  virtual ~ChangesListener() override {}
218 
219  virtual void SAL_CALL disposing(css::lang::EventObject const &) override
220  {
221  osl::MutexGuard g(editor_.mutex_);
222  editor_.m_xNotifier.clear();
223  }
224 
225  virtual void SAL_CALL propertiesChange(
226  css::uno::Sequence< css::beans::PropertyChangeEvent > const &) override
227  {
228  SolarMutexGuard g;
229  editor_.SetFont();
230  }
231 
233 };
234 
236  Window( pParent, WB_BORDER|WB_CLIPCHILDREN ),
237 
238  m_pOutWin(nullptr),
239  m_pHScrollbar(nullptr),
240  m_pVScrollbar(nullptr),
241 
242  m_pSrcView(pParentView),
243 
244  m_nCurTextWidth(0),
245  m_nStartLine(USHRT_MAX),
246  m_eSourceEncoding(osl_getThreadTextEncoding()),
247  m_bReadonly(false),
248  m_bHighlighting(false),
249  m_aSyntaxIdle("sw uibase SwSrcEditWindow Syntax")
250 {
253 
254  // Using "this" in ctor is a little fishy, but should work here at least as
255  // long as there are no derivations:
256  m_xListener = new ChangesListener(*this);
257  css::uno::Reference< css::beans::XMultiPropertySet > n(
259  css::uno::UNO_QUERY_THROW);
260  {
261  osl::MutexGuard g(mutex_);
262  m_xNotifier = n;
263  }
264  css::uno::Sequence< OUString > s(2);
265  s[0] = "FontHeight";
266  s[1] = "FontName";
267  n->addPropertiesChangeListener(s, m_xListener.get());
268 }
269 
271 {
272  disposeOnce();
273 }
274 
276 {
277  css::uno::Reference< css::beans::XMultiPropertySet > n;
278  {
279  osl::MutexGuard g(mutex_);
280  n = m_xNotifier;
281  }
282  if (n.is()) {
283  n->removePropertiesChangeListener(m_xListener.get());
284  }
286  if ( m_pOutWin )
287  m_pOutWin->SetTextView( nullptr );
288 
289  if ( m_pTextEngine )
290  {
292  m_pTextEngine->RemoveView( m_pTextView.get() );
293 
294  m_pTextView.reset();
295  m_pTextEngine.reset();
296  }
301 }
302 
304 {
305  Window::DataChanged( rDCEvt );
306 
307  switch ( rDCEvt.GetType() )
308  {
309  case DataChangedEventType::SETTINGS:
310  // newly rearrange ScrollBars or trigger Resize, because
311  // ScrollBar size could have changed. For this, in the
312  // Resize handler the size of ScrollBars has to be queried
313  // from the settings as well.
314  if( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )
315  Resize();
316  break;
317  default: break;
318  }
319 }
320 
322 {
323  // ScrollBars, etc. happens in Adjust...
324  if ( !m_pTextView )
325  return;
326 
327  long nVisY = m_pTextView->GetStartDocPos().Y();
328  m_pTextView->ShowCursor();
329  Size aOutSz( GetOutputSizePixel() );
330  long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height();
331  if ( nMaxVisAreaStart < 0 )
332  nMaxVisAreaStart = 0;
333  if ( m_pTextView->GetStartDocPos().Y() > nMaxVisAreaStart )
334  {
335  Point aStartDocPos( m_pTextView->GetStartDocPos() );
336  aStartDocPos.setY( nMaxVisAreaStart );
337  m_pTextView->SetStartDocPos( aStartDocPos );
338  m_pTextView->ShowCursor();
339  }
340  long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize();
341  Size aScrollSz(aOutSz.Width() - nScrollStd, nScrollStd );
342  Point aScrollPos(0, aOutSz.Height() - nScrollStd);
343 
344  m_pHScrollbar->SetPosSizePixel( aScrollPos, aScrollSz);
345 
346  aScrollSz.setWidth( aScrollSz.Height() );
347  aScrollSz.setHeight( aOutSz.Height() );
348  aScrollPos = Point(aOutSz.Width() - nScrollStd, 0);
349 
350  m_pVScrollbar->SetPosSizePixel( aScrollPos, aScrollSz);
351  aOutSz.AdjustWidth( -nScrollStd );
352  aOutSz.AdjustHeight( -nScrollStd );
353  m_pOutWin->SetOutputSizePixel(aOutSz);
354  InitScrollBars();
355 
356  // set line in first Resize
357  if(USHRT_MAX != m_nStartLine)
358  {
359  if(m_nStartLine < m_pTextEngine->GetParagraphCount())
360  {
362  m_pTextView->SetSelection(aSel);
363  m_pTextView->ShowCursor();
364  }
366  }
367 
368  if ( nVisY != m_pTextView->GetStartDocPos().Y() )
369  Invalidate();
370 
371 
372 }
373 
375 {
376  Window::DataChanged( rDCEvt );
377 
378  switch( rDCEvt.GetType() )
379  {
380  case DataChangedEventType::SETTINGS:
381  // query settings
382  if( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )
383  {
384  const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
385  SetBackground( rCol );
386  vcl::Font aFont( pTextView->GetTextEngine()->GetFont() );
387  aFont.SetFillColor( rCol );
388  pTextView->GetTextEngine()->SetFont( aFont );
389  }
390  break;
391  default: break;
392  }
393 }
394 
396 {
397  if ( pTextView )
398  pTextView->MouseMove( rEvt );
399 }
400 
402 {
403  if ( pTextView )
404  {
405  pTextView->MouseButtonUp( rEvt );
406  SfxViewFrame *pFrame = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame();
407  if ( pFrame )
408  {
409  SfxBindings& rBindings = pFrame->GetBindings();
410  rBindings.Invalidate( SID_TABLE_CELL );
411  rBindings.Invalidate( SID_CUT );
412  rBindings.Invalidate( SID_COPY );
413  }
414  }
415 }
416 
418 {
419  GrabFocus();
420  if ( pTextView )
421  pTextView->MouseButtonDown( rEvt );
422 }
423 
425 {
426  switch(rCEvt.GetCommand())
427  {
428  case CommandEventId::ContextMenu:
430  break;
431  case CommandEventId::Wheel:
432  case CommandEventId::StartAutoScroll:
433  case CommandEventId::AutoScroll:
434  {
435  const CommandWheelData* pWData = rCEvt.GetWheelData();
436  if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
437  {
438  static_cast<SwSrcEditWindow*>(GetParent())->HandleWheelCommand( rCEvt );
439  }
440  }
441  break;
442 
443  default:
444  if ( pTextView )
445  pTextView->Command( rCEvt );
446  else
447  Window::Command(rCEvt);
448  }
449 }
450 
451 void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
452 {
453  bool bDone = false;
454  SwSrcEditWindow* pSrcEditWin = static_cast<SwSrcEditWindow*>(GetParent());
455  bool bChange = !pSrcEditWin->IsReadonly() || !TextEngine::DoesKeyChangeText( rKEvt );
456  if(bChange)
457  bDone = pTextView->KeyInput( rKEvt );
458 
459  SfxBindings& rBindings = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame()->GetBindings();
460  if ( !bDone )
461  {
462  if ( !SfxViewShell::Current()->KeyInput( rKEvt ) )
463  Window::KeyInput( rKEvt );
464  }
465  else
466  {
467  rBindings.Invalidate( SID_TABLE_CELL );
468  if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR )
469  rBindings.Update( SID_BASICIDE_STAT_POS );
470  if (pSrcEditWin->GetTextEngine()->IsModified() )
471  {
472  rBindings.Invalidate( SID_SAVEDOC );
473  rBindings.Invalidate( SID_DOC_MODIFIED );
474  }
475  if( rKEvt.GetKeyCode().GetCode() == KEY_INSERT )
476  rBindings.Invalidate( SID_ATTR_INSERT );
477  }
478 
479  rBindings.Invalidate( SID_CUT );
480  rBindings.Invalidate( SID_COPY );
481 
482  SwDocShell* pDocShell = pSrcEditWin->GetSrcView()->GetDocShell();
483  if(pSrcEditWin->GetTextEngine()->IsModified())
484  {
485  pDocShell->SetModified();
486  }
487 }
488 
489 void TextViewOutWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
490 {
491  pTextView->Paint(rRenderContext, rRect);
492 }
493 
495 {
496  // FIXME RenderContext
497 
498  const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
501  m_pOutWin->SetPointer(PointerStyle::Text);
502  m_pOutWin->Show();
503 
504  // create Scrollbars
506  m_pHScrollbar->EnableRTL( false );
507  m_pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
508  m_pHScrollbar->Show();
509 
511  m_pVScrollbar->EnableRTL( false );
512  m_pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
514  m_pVScrollbar->Show();
515 
516  m_pTextEngine.reset(new ExtTextEngine);
517  m_pTextView.reset(new TextView( m_pTextEngine.get(), m_pOutWin ));
518  m_pTextView->SetAutoIndentMode(true);
520 
521  m_pTextEngine->SetUpdateMode( false );
522  m_pTextEngine->InsertView( m_pTextView.get() );
523 
524  vcl::Font aFont;
525  aFont.SetTransparent( false );
526  aFont.SetFillColor( rCol );
527  SetPointFont(*this, aFont);
528  aFont = GetFont();
529  aFont.SetFillColor( rCol );
530  m_pOutWin->SetFont( aFont );
531  m_pTextEngine->SetFont( aFont );
532 
533  m_aSyntaxIdle.SetInvokeHandler( LINK( this, SwSrcEditWindow, SyntaxTimerHdl ) );
534 
535  m_pTextEngine->EnableUndo( true );
536  m_pTextEngine->SetUpdateMode( true );
537 
538  m_pTextView->ShowCursor();
539  InitScrollBars();
541 
543  rBind.Invalidate( SID_TABLE_CELL );
544 }
545 
547 {
548  // Extra method, not InitScrollBars, because also for TextEngine events.
549 
551  m_pVScrollbar->SetRange( Range(0, m_pTextEngine->GetTextHeight()-1) );
552 }
553 
555 {
557 
558  Size aOutSz( m_pOutWin->GetOutputSizePixel() );
559  m_pVScrollbar->SetVisibleSize( aOutSz.Height() );
560  m_pVScrollbar->SetPageSize( aOutSz.Height() * 8 / 10 );
562  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
563  m_pHScrollbar->SetVisibleSize( aOutSz.Width() );
564  m_pHScrollbar->SetPageSize( aOutSz.Width() * 8 / 10 );
565  m_pHScrollbar->SetLineSize( m_pOutWin->GetTextWidth(OUString('x')) );
566  m_pHScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().X() );
567 
568 }
569 
570 IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll, void)
571 {
572  if(pScroll == m_pVScrollbar)
573  {
574  long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
575  GetTextView()->Scroll( 0, nDiff );
576  m_pTextView->ShowCursor( false );
577  pScroll->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
578  }
579  else
580  {
581  long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
582  GetTextView()->Scroll( nDiff, 0 );
583  m_pTextView->ShowCursor( false );
584  pScroll->SetThumbPos( m_pTextView->GetStartDocPos().X() );
585  }
586  GetSrcView()->GetViewFrame()->GetBindings().Invalidate( SID_TABLE_CELL );
587 }
588 
589 IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer*, pIdle, void )
590 {
591  tools::Time aSyntaxCheckStart( tools::Time::SYSTEM );
592  SAL_WARN_IF(m_pTextView == nullptr, "sw", "No View yet, but syntax highlighting?!");
593 
594  m_bHighlighting = true;
595  sal_uInt16 nCount = 0;
596  // at first the region around the cursor is processed
597  TextSelection aSel = m_pTextView->GetSelection();
598  sal_uInt16 nCur = static_cast<sal_uInt16>(aSel.GetStart().GetPara());
599  if(nCur > 40)
600  nCur -= 40;
601  else
602  nCur = 0;
603  if(!m_aSyntaxLineTable.empty())
604  for(sal_uInt16 i = 0; i < 80 && nCount < 40; i++, nCur++)
605  {
606  if(m_aSyntaxLineTable.find(nCur) != m_aSyntaxLineTable.end())
607  {
608  DoSyntaxHighlight( nCur );
609  m_aSyntaxLineTable.erase( nCur );
610  nCount++;
611  if(m_aSyntaxLineTable.empty())
612  break;
613  if((tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME )
614  {
615  break;
616  }
617  }
618  }
619 
620  // when there is still anything left by then, go on from the beginning
621  while ( !m_aSyntaxLineTable.empty() && nCount < MAX_SYNTAX_HIGHLIGHT)
622  {
623  sal_uInt16 nLine = *m_aSyntaxLineTable.begin();
624  DoSyntaxHighlight( nLine );
625  m_aSyntaxLineTable.erase(nLine);
626  nCount ++;
627  if(tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME)
628  {
629  break;
630  }
631  }
632 
633  if(!m_aSyntaxLineTable.empty() && !pIdle->IsActive())
634  pIdle->Start();
635  // SyntaxTimerHdl is called when text changed
636  // => good opportunity to determine text width!
637  long nPrevTextWidth = m_nCurTextWidth;
638  m_nCurTextWidth = m_pTextEngine->CalcTextWidth() + 25; // small tolerance
639  if ( m_nCurTextWidth != nPrevTextWidth )
640  SetScrollBarRanges();
641  m_bHighlighting = false;
642 }
643 
644 void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
645 {
646  // Because of DelayedSyntaxHighlight it could happen,
647  // that the line doesn't exist anymore!
648  if ( nPara >= m_pTextEngine->GetParagraphCount() )
649  return;
650 
651  bool bTempModified = IsModified();
652  m_pTextEngine->RemoveAttribs( nPara );
653  OUString aSource( m_pTextEngine->GetText( nPara ) );
654  m_pTextEngine->SetUpdateMode( false );
655  ImpDoHighlight( aSource, nPara );
656  TextView* pTmp = m_pTextEngine->GetActiveView();
657  pTmp->SetAutoScroll(false);
658  m_pTextEngine->SetActiveView(nullptr);
659  m_pTextEngine->SetUpdateMode( true );
660  m_pTextEngine->SetActiveView(pTmp);
661  pTmp->SetAutoScroll(true);
662  pTmp->ShowCursor( false/*pTmp->IsAutoScroll()*/ );
663 
664  if(!bTempModified)
665  ClearModifyFlag();
666 
667 }
668 
669 void SwSrcEditWindow::ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineOff )
670 {
671  TextPortions aPortionList;
672  lcl_Highlight(rSource, aPortionList);
673 
674  size_t nCount = aPortionList.size();
675  if ( !nCount )
676  return;
677 
678  TextPortion& rLast = aPortionList[nCount-1];
679  if ( rLast.nStart > rLast.nEnd ) // Only until Bug from MD is resolved
680  {
681  nCount--;
682  aPortionList.pop_back();
683  if ( !nCount )
684  return;
685  }
686 
687  {
688  // Only blanks and tabs have to be attributed along.
689  // When two identical attributes are placed consecutively,
690  // it optimises the TextEngine.
691  sal_uInt16 nLastEnd = 0;
692 
693  for ( size_t i = 0; i < nCount; i++ )
694  {
695  TextPortion& r = aPortionList[i];
696  if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
697  continue;
698 
699  if ( r.nStart > nLastEnd )
700  {
701  // Can I rely on the fact that all except blank and tab
702  // are being highlighted?!
703  r.nStart = nLastEnd;
704  }
705  nLastEnd = r.nEnd+1;
706  if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.getLength() ) )
707  r.nEnd = rSource.getLength();
708  }
709  }
710 
711  for (TextPortion & r : aPortionList)
712  {
713  if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
714  continue;
715  if(r.eType != svtools::HTMLSGML &&
716  r.eType != svtools::HTMLCOMMENT &&
717  r.eType != svtools::HTMLKEYWORD &&
718  r.eType != svtools::HTMLUNKNOWN)
719  r.eType = svtools::HTMLUNKNOWN;
720  Color aColor(SW_MOD()->GetColorConfig().GetColorValue(r.eType).nColor);
721  m_pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLineOff, r.nStart, r.nEnd+1 );
722  }
723 }
724 
725 void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
726 {
727  const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
728  if (!pTextHint)
729  return;
730 
731  switch (pTextHint->GetId())
732  {
733  case SfxHintId::TextViewScrolled:
734  m_pHScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().X() );
735  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
736  break;
737 
738  case SfxHintId::TextHeightChanged:
739  if ( m_pTextEngine->GetTextHeight() < m_pOutWin->GetOutputSizePixel().Height() )
740  m_pTextView->Scroll( 0, m_pTextView->GetStartDocPos().Y() );
741  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
743  break;
744 
745  case SfxHintId::TextParaInserted:
746  case SfxHintId::TextParaContentChanged:
747  if ( !m_bHighlighting )
748  {
749  m_aSyntaxLineTable.insert( static_cast<sal_uInt16>(pTextHint->GetValue()) );
751  }
752  break;
753  default: break;
754  }
755 }
756 
758 {
760  Window::Invalidate();
761 }
762 
764 {
765  switch(rCEvt.GetCommand())
766  {
767  case CommandEventId::Wheel:
768  case CommandEventId::StartAutoScroll:
769  case CommandEventId::AutoScroll:
770  {
771  const CommandWheelData* pWData = rCEvt.GetWheelData();
772  if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
774  }
775  break;
776  default:
777  Window::Command(rCEvt);
778  }
779 }
780 
782 {
783  m_pTextView->Command(rCEvt);
785 }
786 
788 {
789  if (m_pOutWin)
790  m_pOutWin->GrabFocus();
791 }
792 
793 static bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[])
794 {
795  switch(eEnc)
796  {
797  case RTL_TEXTENCODING_UTF7 :
798  case RTL_TEXTENCODING_UTF8 :
799  // don#t fill - all LANGUAGE_SYSTEM means unicode font has to be used
800  break;
801 
802  case RTL_TEXTENCODING_ISO_8859_3:
803  case RTL_TEXTENCODING_ISO_8859_1 :
804  case RTL_TEXTENCODING_MS_1252 :
805  case RTL_TEXTENCODING_APPLE_ROMAN :
806  case RTL_TEXTENCODING_IBM_850 :
807  case RTL_TEXTENCODING_ISO_8859_14 :
808  case RTL_TEXTENCODING_ISO_8859_15 :
809  //fill with western languages
810  aLanguages[0] = LANGUAGE_GERMAN;
811  aLanguages[1] = LANGUAGE_FRENCH;
812  aLanguages[2] = LANGUAGE_ITALIAN;
813  aLanguages[3] = LANGUAGE_SPANISH;
814  break;
815 
816  case RTL_TEXTENCODING_IBM_865 :
817  //scandinavian
818  aLanguages[0] = LANGUAGE_FINNISH;
819  aLanguages[1] = LANGUAGE_NORWEGIAN;
820  aLanguages[2] = LANGUAGE_SWEDISH;
821  aLanguages[3] = LANGUAGE_DANISH;
822  break;
823 
824  case RTL_TEXTENCODING_ISO_8859_10 :
825  case RTL_TEXTENCODING_ISO_8859_13 :
826  case RTL_TEXTENCODING_ISO_8859_2 :
827  case RTL_TEXTENCODING_IBM_852 :
828  case RTL_TEXTENCODING_MS_1250 :
829  case RTL_TEXTENCODING_APPLE_CENTEURO :
830  aLanguages[0] = LANGUAGE_POLISH;
831  aLanguages[1] = LANGUAGE_CZECH;
832  aLanguages[2] = LANGUAGE_HUNGARIAN;
833  aLanguages[3] = LANGUAGE_SLOVAK;
834  break;
835 
836  case RTL_TEXTENCODING_ISO_8859_4 :
837  case RTL_TEXTENCODING_IBM_775 :
838  case RTL_TEXTENCODING_MS_1257 :
839  aLanguages[0] = LANGUAGE_LATVIAN ;
840  aLanguages[1] = LANGUAGE_LITHUANIAN;
841  aLanguages[2] = LANGUAGE_ESTONIAN ;
842  break;
843 
844  case RTL_TEXTENCODING_IBM_863 : aLanguages[0] = LANGUAGE_FRENCH_CANADIAN; break;
845  case RTL_TEXTENCODING_APPLE_FARSI : aLanguages[0] = LANGUAGE_FARSI; break;
846  case RTL_TEXTENCODING_APPLE_ROMANIAN:aLanguages[0] = LANGUAGE_ROMANIAN; break;
847 
848  case RTL_TEXTENCODING_IBM_861 :
849  case RTL_TEXTENCODING_APPLE_ICELAND :
850  aLanguages[0] = LANGUAGE_ICELANDIC;
851  break;
852 
853  case RTL_TEXTENCODING_APPLE_CROATIAN:aLanguages[0] = LANGUAGE_CROATIAN; break;
854 
855  case RTL_TEXTENCODING_IBM_437 :
856  case RTL_TEXTENCODING_ASCII_US : aLanguages[0] = LANGUAGE_ENGLISH; break;
857 
858  case RTL_TEXTENCODING_IBM_862 :
859  case RTL_TEXTENCODING_MS_1255 :
860  case RTL_TEXTENCODING_APPLE_HEBREW :
861  case RTL_TEXTENCODING_ISO_8859_8 :
862  aLanguages[0] = LANGUAGE_HEBREW;
863  break;
864 
865  case RTL_TEXTENCODING_IBM_857 :
866  case RTL_TEXTENCODING_MS_1254 :
867  case RTL_TEXTENCODING_APPLE_TURKISH:
868  case RTL_TEXTENCODING_ISO_8859_9 :
869  aLanguages[0] = LANGUAGE_TURKISH;
870  break;
871 
872  case RTL_TEXTENCODING_IBM_860 :
873  aLanguages[0] = LANGUAGE_PORTUGUESE;
874  break;
875 
876  case RTL_TEXTENCODING_IBM_869 :
877  case RTL_TEXTENCODING_MS_1253 :
878  case RTL_TEXTENCODING_APPLE_GREEK :
879  case RTL_TEXTENCODING_ISO_8859_7 :
880  case RTL_TEXTENCODING_IBM_737 :
881  aLanguages[0] = LANGUAGE_GREEK;
882  break;
883 
884  case RTL_TEXTENCODING_KOI8_R :
885  case RTL_TEXTENCODING_ISO_8859_5 :
886  case RTL_TEXTENCODING_IBM_855 :
887  case RTL_TEXTENCODING_MS_1251 :
888  case RTL_TEXTENCODING_IBM_866 :
889  case RTL_TEXTENCODING_APPLE_CYRILLIC :
890  aLanguages[0] = LANGUAGE_RUSSIAN;
891  break;
892 
893  case RTL_TEXTENCODING_APPLE_UKRAINIAN:
894  case RTL_TEXTENCODING_KOI8_U:
895  aLanguages[0] = LANGUAGE_UKRAINIAN;
896  break;
897 
898  case RTL_TEXTENCODING_IBM_864 :
899  case RTL_TEXTENCODING_MS_1256 :
900  case RTL_TEXTENCODING_ISO_8859_6 :
901  case RTL_TEXTENCODING_APPLE_ARABIC :
902  aLanguages[0] = LANGUAGE_ARABIC_SAUDI_ARABIA;
903  break;
904 
905  case RTL_TEXTENCODING_APPLE_CHINTRAD :
906  case RTL_TEXTENCODING_MS_950 :
907  case RTL_TEXTENCODING_GBT_12345 :
908  case RTL_TEXTENCODING_BIG5 :
909  case RTL_TEXTENCODING_EUC_TW :
910  case RTL_TEXTENCODING_BIG5_HKSCS :
911  aLanguages[0] = LANGUAGE_CHINESE_TRADITIONAL;
912  break;
913 
914  case RTL_TEXTENCODING_EUC_JP :
915  case RTL_TEXTENCODING_ISO_2022_JP :
916  case RTL_TEXTENCODING_JIS_X_0201 :
917  case RTL_TEXTENCODING_JIS_X_0208 :
918  case RTL_TEXTENCODING_JIS_X_0212 :
919  case RTL_TEXTENCODING_APPLE_JAPANESE :
920  case RTL_TEXTENCODING_MS_932 :
921  case RTL_TEXTENCODING_SHIFT_JIS :
922  aLanguages[0] = LANGUAGE_JAPANESE;
923  break;
924 
925  case RTL_TEXTENCODING_GB_2312 :
926  case RTL_TEXTENCODING_MS_936 :
927  case RTL_TEXTENCODING_GBK :
928  case RTL_TEXTENCODING_GB_18030 :
929  case RTL_TEXTENCODING_APPLE_CHINSIMP :
930  case RTL_TEXTENCODING_EUC_CN :
931  case RTL_TEXTENCODING_ISO_2022_CN :
932  aLanguages[0] = LANGUAGE_CHINESE_SIMPLIFIED;
933  break;
934 
935  case RTL_TEXTENCODING_APPLE_KOREAN :
936  case RTL_TEXTENCODING_MS_949 :
937  case RTL_TEXTENCODING_EUC_KR :
938  case RTL_TEXTENCODING_ISO_2022_KR :
939  case RTL_TEXTENCODING_MS_1361 :
940  aLanguages[0] = LANGUAGE_KOREAN;
941  break;
942 
943  case RTL_TEXTENCODING_APPLE_THAI :
944  case RTL_TEXTENCODING_MS_874 :
945  case RTL_TEXTENCODING_TIS_620 :
946  aLanguages[0] = LANGUAGE_THAI;
947  break;
948  default: aLanguages[0] = Application::GetSettings().GetUILanguageTag().getLanguageType();
949  }
950  return aLanguages[0] != LANGUAGE_SYSTEM;
951 }
953 {
954  OUString sFontName(
956  get_value_or(OUString()));
957  if(sFontName.isEmpty())
958  {
959  LanguageType aLanguages[5] =
960  {
961  LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM
962  };
963  vcl::Font aFont;
965  {
966  //TODO: check for multiple languages
967  aFont = OutputDevice::GetDefaultFont(DefaultFontType::FIXED, aLanguages[0], GetDefaultFontFlags::NONE, this);
968  }
969  else
970  aFont = OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE,
971  Application::GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, this);
972  sFontName = aFont.GetFamilyName();
973  }
974  const SvxFontListItem* pFontListItem =
975  static_cast<const SvxFontListItem* >(m_pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ));
976  const FontList* pList = pFontListItem->GetFontList();
977  FontMetric aFontMetric = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE);
978 
979  const vcl::Font& rFont = GetTextEngine()->GetFont();
980  vcl::Font aFont(aFontMetric);
981  Size aSize(rFont.GetFontSize());
982  //font height is stored in point and set in twip
983  aSize.setHeight(
985  aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapMode(MapUnit::MapTwip)));
986  GetTextEngine()->SetFont( aFont );
987  m_pOutWin->SetFont(aFont);
988 }
989 
990 void SwSrcEditWindow::SetTextEncoding(rtl_TextEncoding eEncoding)
991 {
992  m_eSourceEncoding = eEncoding;
993  SetFont();
994 }
995 
996 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
long Width() const
virtual void EnableRTL(bool bEnable=true) override
#define LANGUAGE_GERMAN
void SetFillColor(const Color &)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
TextEngine * GetTextEngine()
Definition: srcedtw.hxx:125
const vcl::Font & GetFont() const
std::vector< TextPortion > TextPortions
Definition: srcedtw.cxx:69
#define KEYGROUP_CURSOR
virtual void SetModified(bool=true) override
Definition: docsh2.cxx:1397
void SetFontSize(const Size &)
virtual void Command(const CommandEvent &rCEvt) override
Definition: srcedtw.cxx:763
const OUString & GetFamilyName() const
#define LANGUAGE_DANISH
#define LANGUAGE_ARABIC_SAUDI_ARABIA
void InitScrollBars()
Definition: srcedtw.cxx:554
void MouseButtonUp(const MouseEvent &rMouseEvent)
void SetFont(const vcl::Font &rFont)
#define LANGUAGE_ICELANDIC
long AdjustWidth(long n)
#define LANGUAGE_GREEK
friend class ChangesListener
Definition: srcedtw.hxx:65
void MouseMove(const MouseEvent &rMouseEvent)
const LanguageTag & GetUILanguageTag() const
virtual void KeyInput(const KeyEvent &rKeyEvt) override
Definition: srcedtw.cxx:451
InvalidateFlags
long Height() const
void HandleWheelCommand(const CommandEvent &rCEvt)
Definition: srcedtw.cxx:781
#define MAX_HIGHLIGHTTIME
Definition: srcedtw.cxx:67
LanguageType getLanguageType(bool bResolveSystem=true) const
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:395
#define LANGUAGE_LITHUANIAN
const StyleSettings & GetStyleSettings() const
SwSrcView * GetSrcView()
Definition: srcedtw.hxx:127
static const AllSettings & GetSettings()
#define LANGUAGE_RUSSIAN
#define LANGUAGE_KOREAN
Any GetTime(const OUString &val)
VclPtr< ScrollBar > m_pVScrollbar
Definition: srcedtw.hxx:71
sal_uInt16 GetGroup() const
#define LANGUAGE_SPANISH
sal_uInt16 GetCode() const
#define LANGUAGE_UKRAINIAN
sal_uInt16 m_nStartLine
Definition: srcedtw.hxx:82
DataChangedEventType GetType() const
WinBits const WB_VSCROLL
void SetHelpId(const OString &)
const CommandWheelData * GetWheelData() const
rtl::Reference< ChangesListener > m_xListener
Definition: srcedtw.hxx:76
void Invalidate(sal_uInt16 nId)
SwSrcView * m_pSrcView
Definition: srcedtw.hxx:74
virtual void dispose() override
virtual void DataChanged(const DataChangedEvent &) override
Definition: srcedtw.cxx:303
#define LANGUAGE_FRENCH_CANADIAN
static bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[])
Definition: srcedtw.cxx:793
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
long AdjustHeight(long n)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
VclPtr< ScrollBar > m_pHScrollbar
Definition: srcedtw.hxx:71
static void lcl_Highlight(const OUString &rSource, TextPortions &aPortionList)
Definition: srcedtw.cxx:71
#define LANGUAGE_HUNGARIAN
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:417
#define LANGUAGE_PORTUGUESE
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:401
sal_uInt16 sal_Unicode
TextView * pTextView
Definition: srcedtw.hxx:43
void SetBackground()
virtual void SAL_CALL propertiesChange(css::uno::Sequence< css::beans::PropertyChangeEvent > const &) override
Definition: srcedtw.cxx:225
std::unique_ptr< ExtTextEngine > m_pTextEngine
Definition: srcedtw.hxx:68
#define LANGUAGE_SWEDISH
static bool DoesKeyChangeText(const KeyEvent &rKeyEvent)
const vcl::Font & GetFont() const
sal_uLong GetValue() const
VclPtr< TextViewOutWin > m_pOutWin
Definition: srcedtw.hxx:70
WinBits const WB_HSCROLL
#define LANGUAGE_ITALIAN
AllSettingsFlags GetFlags() const
static SfxViewShell * Current()
virtual void Start() override
void SetTextEncoding(rtl_TextEncoding eEncoding)
Definition: srcedtw.cxx:990
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
void DoSyntaxHighlight(sal_uInt16 nPara)
Definition: srcedtw.cxx:644
virtual void SetOutputSizePixel(const Size &rNewSize)
bool m_bHighlighting
Definition: srcedtw.hxx:85
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
Definition: srcedtw.cxx:757
bool IsModified() const
Definition: srcedtw.hxx:135
void SetFont()
Definition: srcedtw.cxx:952
void setY(long nY)
#define LANGUAGE_ROMANIAN
#define LANGUAGE_NORWEGIAN
#define LANGUAGE_CROATIAN
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: srcedtw.cxx:725
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true)
osl::Mutex mutex_
Definition: srcedtw.hxx:77
TextEngine * GetTextEngine() const
#define LANGUAGE_CZECH
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual void Resize() override
Definition: srcedtw.cxx:321
bool KeyInput(const KeyEvent &rKeyEvent)
#define LANGUAGE_HEBREW
void ImpDoHighlight(const OUString &rSource, sal_uInt16 nLineOff)
Definition: srcedtw.cxx:669
void SetAutoScroll(bool bAutoScroll)
bool IsModified() const
#define LANGUAGE_LATVIAN
#define SW_MOD()
Definition: swmodule.hxx:256
virtual void SAL_CALL disposing(css::lang::EventObject const &) override
Definition: srcedtw.cxx:219
Idle m_aSyntaxIdle
Definition: srcedtw.hxx:87
#define LANGUAGE_SYSTEM
long m_nCurTextWidth
Definition: srcedtw.hxx:81
void SetVisibleSize(long nNewSize)
SfxBindings & GetBindings()
int i
CommandWheelMode GetMode() const
void SetRange(const Range &rRange)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
WEIGHT_NORMAL
CommandEventId GetCommand() const
#define LANGUAGE_ESTONIAN
virtual void DataChanged(const DataChangedEvent &) override
Definition: srcedtw.cxx:374
virtual void Command(const CommandEvent &rCEvt) override
Definition: srcedtw.cxx:424
const TextPaM & GetStart() const
const Size & GetFontSize() const
#define LANGUAGE_CHINESE_SIMPLIFIED
void SetPageSize(long nNewSize)
#define LANGUAGE_FARSI
const AllSettings & GetSettings() const
Size GetOutputSizePixel() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
ITALIC_NONE
DocumentType const eType
void GrabFocus()
long GetTextHeight() const
vcl::Window * GetParent() const
IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar *, pScroll, void)
Definition: srcedtw.cxx:570
void MouseButtonDown(const MouseEvent &rMouseEvent)
#define LANGUAGE_THAI
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void SetScrollBarRanges()
Definition: srcedtw.cxx:546
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: srcedtw.cxx:489
css::uno::Reference< css::beans::XMultiPropertySet > m_xNotifier
Definition: srcedtw.hxx:79
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
void SetLineSize(long nNewSize)
HtmlTokenId
Point LogicToPixel(const Point &rLogicPt) const
void Update(sal_uInt16 nId)
WinBits const WB_3DLOOK
rtl_TextEncoding m_eSourceEncoding
Definition: srcedtw.hxx:83
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
void SetPointer(PointerStyle)
void CreateTextEngine()
Definition: srcedtw.cxx:494
const vcl::KeyCode & GetKeyCode() const
#define LANGUAGE_FRENCH
#define LANGUAGE_ENGLISH
void Stop()
void SetTextView(TextView *pView)
Definition: srcedtw.hxx:58
#define SAL_WARN_IF(condition, area, stream)
#define LANGUAGE_POLISH
WinBits const WB_BORDER
std::set< sal_uInt16 > m_aSyntaxLineTable
Definition: srcedtw.hxx:88
void SetFont(const vcl::Font &rNewFont)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
void SetTransparent(bool bTransparent)
virtual ~SwSrcEditWindow() override
Definition: srcedtw.cxx:270
#define MAX_SYNTAX_HIGHLIGHT
Definition: srcedtw.cxx:66
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
#define LANGUAGE_SLOVAK
std::unique_ptr< TextView > m_pTextView
Definition: srcedtw.hxx:67
static VclPtr< reference_type > Create(Arg &&...arg)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual void GetFocus() override
Definition: srcedtw.cxx:787
sal_Int64 GetTime() const
#define LANGUAGE_TURKISH
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual ~ChangesListener() override
Definition: srcedtw.cxx:217
const Color & GetWindowColor() const
void EnableDrag()
ChangesListener(SwSrcEditWindow &editor)
Definition: srcedtw.cxx:214
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
#define KEY_INSERT
#define SAL_WARN(area, stream)
#define LANGUAGE_CHINESE_TRADITIONAL
#define LANGUAGE_FINNISH
SwSrcEditWindow(vcl::Window *pParent, SwSrcView *pParentView)
Definition: srcedtw.cxx:235
const FontList * GetFontList() const
long GetScrollBarSize() const
bool IsReadonly() const
Definition: srcedtw.hxx:139
#define LANGUAGE_JAPANESE
virtual void dispose() override
Definition: srcedtw.cxx:275
DefTokenId const nToken
WinBits const WB_CLIPCHILDREN
void Command(const CommandEvent &rCEvt)
sal_uInt32 GetPara() const
void SetThumbPos(long nThumbPos)
#define HID_SOURCE_EDITWIN
Definition: helpids.h:32
void ClearModifyFlag()
Definition: srcedtw.hxx:133
WinBits const WB_DRAG
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void setHeight(long nHeight)
SwDocShell * GetDocShell()
Definition: srcview.cxx:264