edtwin.cxx (4d7c9de0) edtwin.cxx (23d8f725)
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

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

296
297
298void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
299{
300 SwWrtShell &rSh = rView.GetWrtShell();
301 if( pApplyTempl )
302 {
303 PointerStyle eStyle = POINTER_FILL;
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

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

296
297
298void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
299{
300 SwWrtShell &rSh = rView.GetWrtShell();
301 if( pApplyTempl )
302 {
303 PointerStyle eStyle = POINTER_FILL;
304 if( rSh.IsOverReadOnlyPos( rLPt ))
304 if ( rSh.IsOverReadOnlyPos( rLPt ) )
305 {
306 if( pUserMarker )
307 {
308 delete pUserMarker;
309 pUserMarker = 0L;
310 }
311 eStyle = POINTER_NOTALLOWED;
312 }

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

1846 eKeyState = KS_NoNum;
1847 }
1848 else if( rSh.CanSpecialInsert() )
1849 eKeyState = KS_SpecialInsert;
1850 break;
1851
1852 case KEY_BACKSPACE:
1853 case KEY_BACKSPACE | KEY_SHIFT:
305 {
306 if( pUserMarker )
307 {
308 delete pUserMarker;
309 pUserMarker = 0L;
310 }
311 eStyle = POINTER_NOTALLOWED;
312 }

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

1846 eKeyState = KS_NoNum;
1847 }
1848 else if( rSh.CanSpecialInsert() )
1849 eKeyState = KS_SpecialInsert;
1850 break;
1851
1852 case KEY_BACKSPACE:
1853 case KEY_BACKSPACE | KEY_SHIFT:
1854 if( !rSh.HasReadonlySel() )
1854 if ( !rSh.HasReadonlySel()
1855 && !rSh.CrsrInsideInputFld() )
1855 {
1856 sal_Bool bDone = sal_False;
1857 // Remove the paragraph indent, if the cursor is at the
1858 // beginning of a paragraph, there is no selection
1859 // and no numbering rule found at the current paragraph
1860 // Also try to remove indent, if current paragraph
1861 // has numbering rule, but isn't counted and only
1862 // key <backspace> is hit.
1856 {
1857 sal_Bool bDone = sal_False;
1858 // Remove the paragraph indent, if the cursor is at the
1859 // beginning of a paragraph, there is no selection
1860 // and no numbering rule found at the current paragraph
1861 // Also try to remove indent, if current paragraph
1862 // has numbering rule, but isn't counted and only
1863 // key <backspace> is hit.
1863 const bool bOnlyBackspaceKey(
1864 KEY_BACKSPACE == rKeyCode.GetFullCode() );
1865 if ( rSh.IsSttPara() &&
1866 !rSh.HasSelection() && // i40834
1867 ( NULL == rSh.GetCurNumRule() ||
1868 ( rSh.IsNoNum() && bOnlyBackspaceKey ) ) )
1864 const bool bOnlyBackspaceKey( KEY_BACKSPACE == rKeyCode.GetFullCode() );
1865 if ( rSh.IsSttPara()
1866 && !rSh.HasSelection()
1867 && ( rSh.GetCurNumRule() == NULL
1868 || ( rSh.IsNoNum() && bOnlyBackspaceKey ) ) )
1869 {
1870 bDone = rSh.TryRemoveIndent();
1871 }
1872
1873 if (bDone)
1874 eKeyState = KS_Ende;
1875 else
1876 {
1869 {
1870 bDone = rSh.TryRemoveIndent();
1871 }
1872
1873 if (bDone)
1874 eKeyState = KS_Ende;
1875 else
1876 {
1877 if (rSh.IsSttPara() &&
1878 ! rSh.IsNoNum())
1877 if ( rSh.IsSttPara() && !rSh.IsNoNum() )
1879 {
1878 {
1880 if (nKS_NUMDOWN_Count > 0 &&
1881 0 < rSh.GetNumLevel())
1879 if (nKS_NUMDOWN_Count > 0
1880 && rSh.GetNumLevel() > 0)
1882 {
1883 eKeyState = KS_NumUp;
1884 nKS_NUMDOWN_Count = 2;
1885 bDone = sal_True;
1886 }
1887 else if (nKS_NUMINDENTINC_Count > 0)
1888 {
1889 eKeyState = KS_NumIndentDec;
1890 nKS_NUMINDENTINC_Count = 2;
1891 bDone = sal_True;
1892 }
1893 }
1894 // If the cursor is in an empty paragraph, which has
1881 {
1882 eKeyState = KS_NumUp;
1883 nKS_NUMDOWN_Count = 2;
1884 bDone = sal_True;
1885 }
1886 else if (nKS_NUMINDENTINC_Count > 0)
1887 {
1888 eKeyState = KS_NumIndentDec;
1889 nKS_NUMINDENTINC_Count = 2;
1890 bDone = sal_True;
1891 }
1892 }
1893 // If the cursor is in an empty paragraph, which has
1895 // a numbering, but not the oultine numbering, and
1894 // a numbering, but not the outline numbering, and
1896 // there is no selection, the numbering has to be
1897 // deleted on key <Backspace>.
1898 // Otherwise method <SwEditShell::NumOrNoNum(..)>
1899 // should only change the <IsCounted()> state of
1900 // the current paragraph depending of the key.
1901 // On <backspace> it is set to <false>,
1902 // on <shift-backspace> it is set to <true>.
1903 // Thus, assure that method <SwEditShell::NumOrNum(..)>
1904 // is only called for the intended purpose.
1895 // there is no selection, the numbering has to be
1896 // deleted on key <Backspace>.
1897 // Otherwise method <SwEditShell::NumOrNoNum(..)>
1898 // should only change the <IsCounted()> state of
1899 // the current paragraph depending of the key.
1900 // On <backspace> it is set to <false>,
1901 // on <shift-backspace> it is set to <true>.
1902 // Thus, assure that method <SwEditShell::NumOrNum(..)>
1903 // is only called for the intended purpose.
1905 bool bCallNumOrNoNum( false );
1904 if ( !bDone && rSh.IsSttPara() )
1906 {
1905 {
1907 if ( !bDone )
1906 bool bCallNumOrNoNum( false );
1907 if ( bOnlyBackspaceKey && !rSh.IsNoNum() )
1908 {
1908 {
1909 if ( bOnlyBackspaceKey && !rSh.IsNoNum() )
1909 bCallNumOrNoNum = true;
1910 }
1911 else if ( !bOnlyBackspaceKey && rSh.IsNoNum() )
1912 {
1913 bCallNumOrNoNum = true;
1914 }
1915 else if ( bOnlyBackspaceKey
1916 && rSh.IsSttPara()
1917 && rSh.IsEndPara()
1918 && !rSh.HasSelection() )
1919 {
1920 const SwNumRule* pCurrNumRule( rSh.GetCurNumRule() );
1921 if ( pCurrNumRule != NULL
1922 && pCurrNumRule != rSh.GetOutlineNumRule() )
1910 {
1911 bCallNumOrNoNum = true;
1912 }
1923 {
1924 bCallNumOrNoNum = true;
1925 }
1913 else if ( !bOnlyBackspaceKey && rSh.IsNoNum() )
1914 {
1915 bCallNumOrNoNum = true;
1916 }
1917 else if ( bOnlyBackspaceKey &&
1918 rSh.IsSttPara() && rSh.IsEndPara() &&
1919 !rSh.HasSelection() )
1920 {
1921 const SwNumRule* pCurrNumRule( rSh.GetCurNumRule() );
1922 if ( pCurrNumRule &&
1923 pCurrNumRule != rSh.GetOutlineNumRule() )
1924 {
1925 bCallNumOrNoNum = true;
1926 }
1927 }
1928 }
1926 }
1927 if ( bCallNumOrNoNum
1928 && rSh.NumOrNoNum( !bOnlyBackspaceKey, sal_True ) )
1929 {
1930 eKeyState = KS_NumOrNoNum;
1931 }
1929 }
1932 }
1930 if ( bCallNumOrNoNum &&
1931 rSh.NumOrNoNum( !bOnlyBackspaceKey, sal_True ) )
1932 {
1933 eKeyState = KS_NumOrNoNum;
1934 }
1935 // <--
1936 }
1937 }
1938 break;
1939
1940 case KEY_RIGHT:
1941 {
1942 eFlyState = KS_Fly_Change;
1943 nDir = MOVE_RIGHT_BIG;

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

1955 {
1956 eKeyState=KS_GotoNextFieldMark;
1957 }
1958 else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
1959 {
1960 GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_NEXT_INPUTFLD );
1961 eKeyState = KS_Ende;
1962 }
1933 }
1934 }
1935 break;
1936
1937 case KEY_RIGHT:
1938 {
1939 eFlyState = KS_Fly_Change;
1940 nDir = MOVE_RIGHT_BIG;

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

1952 {
1953 eKeyState=KS_GotoNextFieldMark;
1954 }
1955 else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
1956 {
1957 GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_NEXT_INPUTFLD );
1958 eKeyState = KS_Ende;
1959 }
1963 else
1964 if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
1965 !rSh.HasReadonlySel() )
1960 else if( rSh.GetCurNumRule()
1961 && rSh.IsSttOfPara()
1962 && !rSh.HasReadonlySel() )
1966 {
1967 if ( rSh.IsFirstOfNumRule() &&
1968 numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
1969 eKeyState = KS_NumIndentInc;
1970 else
1971 eKeyState = KS_NumDown;
1972 }
1973 else if ( rSh.GetTableFmt() )

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

2014 {
2015 eKeyState=KS_GotoPrevFieldMark;
2016 }
2017 else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
2018 {
2019 GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_PREV_INPUTFLD );
2020 eKeyState = KS_Ende;
2021 }
1963 {
1964 if ( rSh.IsFirstOfNumRule() &&
1965 numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
1966 eKeyState = KS_NumIndentInc;
1967 else
1968 eKeyState = KS_NumDown;
1969 }
1970 else if ( rSh.GetTableFmt() )

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

2011 {
2012 eKeyState=KS_GotoPrevFieldMark;
2013 }
2014 else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
2015 {
2016 GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_PREV_INPUTFLD );
2017 eKeyState = KS_Ende;
2018 }
2022 else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
2023 !rSh.HasReadonlySel() )
2019 else if( rSh.GetCurNumRule()
2020 && rSh.IsSttOfPara()
2021 && !rSh.HasReadonlySel() )
2024 {
2025 if ( rSh.IsFirstOfNumRule() &&
2026 numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
2027 eKeyState = KS_NumIndentDec;
2028 else
2029 eKeyState = KS_NumUp;
2030 }
2031 else if ( rSh.GetTableFmt() )

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

2303 "where is the otherpos?");
2304 if (pFieldmark->IsExpanded())
2305 {
2306 rSh.CalcLayout();
2307 }
2308 }
2309 eKeyState = KS_Ende;
2310 }
2022 {
2023 if ( rSh.IsFirstOfNumRule() &&
2024 numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
2025 eKeyState = KS_NumIndentDec;
2026 else
2027 eKeyState = KS_NumUp;
2028 }
2029 else if ( rSh.GetTableFmt() )

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

2301 "where is the otherpos?");
2302 if (pFieldmark->IsExpanded())
2303 {
2304 rSh.CalcLayout();
2305 }
2306 }
2307 eKeyState = KS_Ende;
2308 }
2311 else if(!rSh.HasReadonlySel())
2309 else if ( !rSh.HasReadonlySel()
2310 || rSh.CrsrInsideInputFld() )
2312 {
2311 {
2313 sal_Bool bIsNormalChar = GetAppCharClass().isLetterNumeric(
2314 String( aCh ), 0 );
2312 const sal_Bool bIsNormalChar =
2313 GetAppCharClass().isLetterNumeric( String( aCh ), 0 );
2315 if( bChkInsBlank && bIsNormalChar &&
2316 (aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() ))
2317 {
2318 // vor dem Zeichen noch ein Blank einfuegen. Dieses
2319 // kommt zwischen den Expandierten Text und dem neuen
2320 // "nicht Worttrenner".
2321 aInBuffer.Expand( aInBuffer.Len() + 1, ' ' );
2322 }
2323
2314 if( bChkInsBlank && bIsNormalChar &&
2315 (aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() ))
2316 {
2317 // vor dem Zeichen noch ein Blank einfuegen. Dieses
2318 // kommt zwischen den Expandierten Text und dem neuen
2319 // "nicht Worttrenner".
2320 aInBuffer.Expand( aInBuffer.Len() + 1, ' ' );
2321 }
2322
2324
2325 sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh );
2326 sal_Bool bRunNext = pACorr && pACorr->HasRunNext();
2323 const sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh );
2324 const sal_Bool bRunNext = pACorr != NULL && pACorr->HasRunNext();
2327 if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) &&
2328 pACfg->IsAutoFmtByInput() &&
2329 (( pACorr->IsAutoCorrFlag( ChgWeightUnderl ) &&
2330 ( '*' == aCh || '_' == aCh ) ) ||
2331 ( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
2332 ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
2333 {
2334 FlushInBuffer();

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

3394
3395 bNoInterrupt = bTmpNoInterrupt;
3396 }
3397 if ( !bOverURLGrf && !bOnlyText )
3398 {
3399 const int nSelType = rSh.GetSelectionType();
3400 // Check in general, if an object is selectable at given position.
3401 // Thus, also text fly frames in background become selectable via Ctrl-Click.
2325 if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) &&
2326 pACfg->IsAutoFmtByInput() &&
2327 (( pACorr->IsAutoCorrFlag( ChgWeightUnderl ) &&
2328 ( '*' == aCh || '_' == aCh ) ) ||
2329 ( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
2330 ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
2331 {
2332 FlushInBuffer();

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

3392
3393 bNoInterrupt = bTmpNoInterrupt;
3394 }
3395 if ( !bOverURLGrf && !bOnlyText )
3396 {
3397 const int nSelType = rSh.GetSelectionType();
3398 // Check in general, if an object is selectable at given position.
3399 // Thus, also text fly frames in background become selectable via Ctrl-Click.
3402 if ( nSelType & nsSelectionType::SEL_OLE ||
3403 nSelType & nsSelectionType::SEL_GRF ||
3404 rSh.IsObjSelectable( aDocPos ) )
3400 if ( ( nSelType & nsSelectionType::SEL_OLE )
3401 || ( nSelType & nsSelectionType::SEL_GRF )
3402 || rSh.IsObjSelectable( aDocPos ) )
3405 {
3406 MV_KONTEXT( &rSh );
3407 if( !rSh.IsFrmSelected() )
3408 rSh.GotoNextFly();
3409 rSh.EnterSelFrmMode();
3410 bCallBase = sal_False;
3411 }
3412 }

--- 2361 unchanged lines hidden ---
3403 {
3404 MV_KONTEXT( &rSh );
3405 if( !rSh.IsFrmSelected() )
3406 rSh.GotoNextFly();
3407 rSh.EnterSelFrmMode();
3408 bCallBase = sal_False;
3409 }
3410 }

--- 2361 unchanged lines hidden ---