Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sonoisa committed Nov 11, 2018
2 parents abe44b6 + 8045ead commit 0b1f21c
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 70 deletions.
28 changes: 24 additions & 4 deletions FindPanel/Controllers/OgreAdvancedFindPanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ - (void)setFindString:(NSAttributedString*)attrString
}

// replace
[textStorage replaceCharactersInRange:oldRange withAttributedString:findString];
// スタイル情報は捨てる。
[textStorage replaceCharactersInRange:oldRange withString:[findString string]];
}

- (void)setReplaceString:(NSAttributedString*)attrString
Expand All @@ -731,7 +732,12 @@ - (void)setReplaceString:(NSAttributedString*)attrString
}

// replace
[textStorage replaceCharactersInRange:oldRange withAttributedString:replaceString];
if ([self replaceWithStylesOption]) {
[textStorage replaceCharactersInRange:oldRange withAttributedString:replaceString];
} else {
// スタイル情報は捨てる。
[textStorage replaceCharactersInRange:oldRange withString:[replaceString string]];
}
}

- (void)undoableReplaceCharactersInRange:(NSRange)oldRange
Expand Down Expand Up @@ -1311,7 +1317,8 @@ - (IBAction)useSelectionForFind:(id)sender

NSAttributedString *selectedAttrString = [textFinder selectedAttributedString];
if (selectedAttrString != nil) {
[[findTextView textStorage] setAttributedString:selectedAttrString];
// [[findTextView textStorage] setAttributedString:selectedAttrString];
[[findTextView textStorage] replaceCharactersInRange:NSMakeRange(0, [[findTextView textStorage] length]) withString:[selectedAttrString string]];
//if (sender != self) [self showFindPanel:sender];
} else {
NSBeep();
Expand All @@ -1328,7 +1335,11 @@ - (IBAction)useSelectionForReplace:(id)sender

NSAttributedString *selectedAttrString = [textFinder selectedAttributedString];
if (selectedAttrString != nil) {
[[replaceTextView textStorage] setAttributedString:selectedAttrString];
if ([self replaceWithStylesOption]) {
[[replaceTextView textStorage] setAttributedString:selectedAttrString];
} else {
[[replaceTextView textStorage] replaceCharactersInRange:NSMakeRange(0, [[replaceTextView textStorage] length]) withString:[selectedAttrString string]];
}
//if (sender != self) [self showFindPanel:sender];
} else {
NSBeep();
Expand Down Expand Up @@ -1570,6 +1581,15 @@ - (BOOL)replaceWithStylesOption
- (void)setReplaceWithStylesOption:(BOOL)aReplaceWithStylesOption
{
replaceWithStylesOption = aReplaceWithStylesOption;

// スタイルを利用する場合はreplaceTextViewをrichにする。
[replaceTextView setRichText:replaceWithStylesOption];
[replaceTextView setUsesFontPanel:replaceWithStylesOption];

if (!replaceWithStylesOption) {
// スタイルを利用しない場合はスタイルを削除する。
[self clearReplaceStringStyles:self];
}
}

- (BOOL)replaceFontsOption
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading

0 comments on commit 0b1f21c

Please sign in to comment.