| 837 | |
| 838 | #if 0 |
| 839 | void ApplyEditCommands() |
| 840 | { |
| 841 | outA = mAText; |
| 842 | int aOffset = 0; |
| 843 | |
| 844 | Array<int> deferredFromSources; |
| 845 | |
| 846 | for (int i = 0; i < (int)outA.size(); i++) |
| 847 | { |
| 848 | outA[i] = toupper(outA[i]); |
| 849 | } |
| 850 | |
| 851 | for (int editCmdIdx = 0; editCmdIdx < (int)editCommands.size(); editCmdIdx++) |
| 852 | { |
| 853 | EditCommand* editCommand = &editCommands[editCmdIdx]; |
| 854 | if (editCommand->mAIdx == -1) |
| 855 | continue; |
| 856 | |
| 857 | if (editCommand->mCmd == EditCommandKind_DeleteLine) |
| 858 | { |
| 859 | // Delete line |
| 860 | //outA.erase(outA.begin() + (editCommand->mAIdx + aOffset)); |
| 861 | LineData* lineData = &mALineDatas[editCommand->mAIdx]; |
| 862 | outA.erase(outA.begin() + (lineData->mBufStart + aOffset), outA.begin() + (lineData->mBufStart + lineData->mBufLength + aOffset)); |
| 863 | aOffset -= lineData->mBufLength; |
| 864 | } |
| 865 | else if (editCommand->mCmd == EditCommandKind_DeleteChar) |
| 866 | { |
| 867 | outA.erase( |
| 868 | outA.begin() + (editCommand->mAIdx + aOffset), |
| 869 | outA.begin() + (editCommand->mAIdx + 1 + aOffset)); |
| 870 | aOffset--; |
| 871 | } |
| 872 | else if (editCommand->mCmd == EditCommandKind_InsertChar) |
| 873 | { |
| 874 | outA.insert(outA.begin() + (editCommand->mAIdx + aOffset), |
| 875 | mBText.begin() + editCommand->mBIdx, |
| 876 | mBText.begin() + editCommand->mBIdx + 1); |
| 877 | aOffset++; |
| 878 | } |
| 879 | else if (editCommand->mCmd == EditCommandKind_InsertLine) |
| 880 | { |
| 881 | // Insert line |
| 882 | int insertPosition = GetInsertPosition(editCommand->mAIdx); |
| 883 | LineData* bLineData = &mBLineDatas[editCommand->mBIdx]; |
| 884 | |
| 885 | outA.insert(outA.begin() + (insertPosition + aOffset), |
| 886 | mBText.begin() + bLineData->mBufStart, mBText.begin() + bLineData->mBufStart + bLineData->mBufLength); |
| 887 | aOffset += bLineData->mBufLength; |
| 888 | } |
| 889 | else if (editCommand->mCmd == EditCommandKind_MoveLineFrom) |
| 890 | { |
| 891 | LineData* aLineDataSrc = &mALineDatas[editCommand->mAIdx]; |
| 892 | editCommand->mAltParam = aLineDataSrc->mBufStart + aOffset; |
| 893 | deferredFromSources.push_back(editCmdIdx); |
| 894 | //editC |
| 895 | |
| 896 | // Move line |